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); }
/// <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); }
public static Vector2 GetWorldPosition(Vector2 position, Camera2D camera) { return Vector2.Transform(position, camera.InverseTransform); }