setViewPos() public method

Center the screen on the given world coordinate
public setViewPos ( Vector2 pos ) : void
pos Vector2 World Coordinate
return void
Example #1
0
        public void Update(GameTime theGameTime, Map map)
        {
            KeyboardState currentKeyboardState = Keyboard.GetState();
            UpdateMovement(currentKeyboardState);
            UpdateRocket(theGameTime, currentKeyboardState, map);
            mPreviousKeyboardState = currentKeyboardState;

            map.setViewPos(mPosition);

            base.Update(theGameTime, mSpeed, mDirection);
        }
Example #2
0
        public void Update(GameTime theGameTime, Map map)
        {
            KeyboardState currentKeyboardState = Keyboard.GetState();

            UpdateMovement(currentKeyboardState);
            UpdateRocket(theGameTime, currentKeyboardState, map);
            mPreviousKeyboardState = currentKeyboardState;

            map.setViewPos(mPosition);

            base.Update(theGameTime, mSpeed, mDirection);
        }