Esempio n. 1
0
        public static void Initialize(Game aGame, GraphicsDevice aGraphicsDevice)
        {
            Random = new Random();

            _game = aGame;
            _graphicsDevice = aGraphicsDevice;
            _spriteBatch = new SpriteBatch(_graphicsDevice);
            _content = _game.Content;

            _mainCamera = new Camera2D(GraphicsDevice.Viewport, Vector2.Zero);

            InitializeManagers();

            DebugInfo = String.Format("FPS: {0}", _frameRate);
        }
Esempio n. 2
0
 /// <summary>
 /// Get the position of the mouse in the world
 /// </summary>
 /// <param name="camera">The user's camera.  Mouse world position is calculated based on it's values</param>
 /// <returns>the position of the mouse in the world</returns>
 public static Vector2 GetMouseWorldPosition(Camera2D camera)
 {
     return Vector2.Transform(RawMousePosition, camera.InverseTransform);
 }
Esempio n. 3
0
 public static Vector2 GetWorldPosition(Vector2 position, Camera2D camera)
 {
     return Vector2.Transform(position, camera.InverseTransform);
 }