Beispiel #1
0
        /// <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;
        }
Beispiel #2
0
 /// <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;
 }
Beispiel #3
0
 public void SetDimensions(Vector2 dim)
 {
     WorldCamera.ViewDimensions = dim;
     WorldSpace.SetDimensions(dim);
 }
Beispiel #4
0
        /// <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;
        }