/// <summary> /// Creates a new WorldState instance. /// </summary> /// <param name="device">A GraphicsDevice used for rendering.</param> /// <param name="worldPxWidth">Width of world in pixels.</param> /// <param name="worldPxHeight">Height of world in pixels.</param> /// <param name="world">A World instance.</param> public WorldState(GraphicsDevice device, float worldPxWidth, float worldPxHeight, World world) { this.Device = device; this.World = world; this.WorldCamera = new WorldCamera(device); WorldCamera.ViewDimensions = new Vector2(worldPxWidth, worldPxHeight); WorldSpace = new WorldSpace(worldPxWidth, worldPxHeight, this); Zoom = WorldZoom.Near; Rotation = WorldRotation.TopLeft; Level = 1; }
/// <summary> /// Creates a new WorldState instance. /// </summary> /// <param name="device">A GraphicsDevice used for rendering.</param> /// <param name="worldPxWidth">Width of world in pixels.</param> /// <param name="worldPxHeight">Height of world in pixels.</param> /// <param name="world">A World instance.</param> public WorldState(GraphicsDevice device, float worldPxWidth, float worldPxHeight, World world) { this.Device = device; this.World = world; this.WorldCamera = new WorldCamera(device); this.FramePerDraw = 30f / FSOEnvironment.RefreshRate; WorldCamera.ViewDimensions = new Vector2(worldPxWidth, worldPxHeight); Rooms = new GPURoomMaps(device); WorldSpace = new WorldSpace(worldPxWidth, worldPxHeight, this); Zoom = WorldZoom.Near; Rotation = WorldRotation.TopLeft; Level = 1; }
public void SetDimensions(Vector2 dim) { WorldCamera.ViewDimensions = dim; WorldSpace.SetDimensions(dim); }
/// <summary> /// Creates a new WorldState instance. /// </summary> /// <param name="device">A GraphicsDevice used for rendering.</param> /// <param name="worldPxWidth">Width of world in pixels.</param> /// <param name="worldPxHeight">Height of world in pixels.</param> /// <param name="world">A World instance.</param> public WorldState(GraphicsDevice device, float worldPxWidth, float worldPxHeight, World world) { this.Device = device; this.World = world; this.WorldCamera = new WorldCamera(device); WorldSpace = new WorldSpace(worldPxWidth, worldPxHeight, this); Zoom = WorldZoom.Near; Rotation = WorldRotation.TopLeft; Level = 1; }