ResetCamera() public method

Resets the camera to default values.
public ResetCamera ( ) : void
return void
Exemplo n.º 1
0
        public override void LoadContent()
        {
            if (World == null)
            {
                World = new World(Vector2.Zero);
            }
            else
            {
                World.Clear();
            }

            if (DebugView == null)
            {
                DebugView = new DebugViewXNA(World);
                DebugView.DefaultShapeColor  = Color.White;
                DebugView.SleepingShapeColor = Color.LightGray;
                DebugView.LoadContent(Framework.GraphicsDevice, Framework.Content);
            }

            DebugView.Flags = _flags;
            _flagsChanged   = false;

            if (Camera == null)
            {
                Camera = new Camera2D(Framework.GraphicsDevice);
            }
            else
            {
                Camera.ResetCamera();
            }

            base.LoadContent();
        }
Exemplo n.º 2
0
        public override void LoadContent()
        {
            base.LoadContent();

            if (World == null)
            {
                World = new World(Vector2.Zero);
            }
            else
            {
                World.Clear();
            }

            if (DebugView == null)
            {
                DebugView = new DebugViewXNA(World);
                DebugView.RemoveFlags(DebugViewFlags.Shape);
                DebugView.RemoveFlags(DebugViewFlags.Joint);
                DebugView.DefaultShapeColor  = Color.White;
                DebugView.SleepingShapeColor = Color.LightGray;
                DebugView.LoadContent(ScreenManager.GraphicsDevice, ScreenManager.Content);
            }

            if (Camera == null)
            {
                Camera = new Camera2D(ScreenManager.GraphicsDevice);
            }
            else
            {
                Camera.ResetCamera();
            }

            HiddenBody = BodyFactory.CreateBody(World, Vector2.Zero);

            // Loading may take a while... so prevent the game from "catching up" once we finished loading
            ScreenManager.Game.ResetElapsedTime();
        }