/// <summary> /// Reset for a draw loop /// </summary> public void Begin(WorldCamera camera2D) { this.WorldCamera = camera2D; camera2D.ProjectionDirty(); this.Sprites.Clear(); SpriteIndex = 0; this.DrawOrder = 0; }
private void UISimInit() { Camera = new WorldCamera(GameFacade.GraphicsDevice); Camera.Zoom = LotView.WorldZoom.Near; Camera.CenterTile = new Vector2(-1, -1)*FSOEnvironment.DPIScaleFactor; Scene = new _3DTargetScene(GameFacade.Game.GraphicsDevice, Camera, new Point(140 * FSOEnvironment.DPIScaleFactor, 200 * FSOEnvironment.DPIScaleFactor), (GlobalSettings.Default.AntiAlias)?8:0); Scene.ID = "UISim"; GameFacade.Game.GraphicsDevice.DeviceReset += new EventHandler<EventArgs>(GraphicsDevice_DeviceReset); Avatar = new AdultVitaboyModel(); Avatar.Scene = Scene; var scale = FSOEnvironment.DPIScaleFactor; Avatar.Scale = new Vector3(scale, scale, scale); Scene.Add(Avatar); }
/// <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; }