public class Game
extends java.lang.Object
implements System.IDisposable
Modifier and Type | Field and Description |
---|---|
System.Event<System.EventArgs> |
Activated
Raised when the game gains focus.
|
Microsoft.Xna.Framework.Content.ContentManager |
Content
Gets or sets the current ContentManager.
|
System.Event<System.EventArgs> |
Deactivated
Raised when the game loses focus.
|
System.Event<System.EventArgs> |
Disposed
Raised when the game is being disposed.
|
System.Event<System.EventArgs> |
Exiting
Raised when the game is exiting.
|
System.TimeSpan |
TargetElapsedTime
Gets or sets the target time between calls to Update when IsFixedTimeStep is true.
|
Constructor and Description |
---|
Game()
Initializes a new instance of this class, which provides basic graphics device initialization, game logic, rendering code, and a game loop.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
BeginDraw() |
protected void |
BeginRun() |
void |
Dispose() |
protected void |
Dispose(boolean disposing) |
protected void |
Draw(GameTime gameTime) |
protected void |
EndDraw() |
void |
Exit()
Exits the game.
|
protected void |
finalize() |
Microsoft.Xna.Framework.Graphics.GraphicsDevice |
getGraphicsDevice()
Gets the current GraphicsDevice.
|
boolean |
getIsActive()
Indicates whether the game is currently the active application.
|
boolean |
getIsMouseVisible() |
GameServiceContainer |
getServices()
Gets the GameServiceContainer holding all the service providers attached to the Game.
|
GameWindow |
getWindow()
Gets the underlying operating system window.
|
protected void |
Initialize()
Called after the Game and GraphicsDevice are created, but before LoadContent.
|
protected void |
LoadContent() |
void |
ResetElapsedTime()
Resets the elapsed time counter.
|
void |
Run()
Call this method to initialize the game, begin running the game loop, and start processing events for the game.
|
void |
RunOneFrame()
Run the game through what would happen in a single tick of the game clock; this method is designed for debugging only.
|
void |
setIsMouseVisible(boolean value) |
void |
Tick() |
protected void |
UnloadContent() |
protected void |
Update(GameTime gameTime) |
public System.TimeSpan TargetElapsedTime
public Microsoft.Xna.Framework.Content.ContentManager Content
public final System.Event<System.EventArgs> Activated
public final System.Event<System.EventArgs> Deactivated
public final System.Event<System.EventArgs> Disposed
public final System.Event<System.EventArgs> Exiting
public Game()
public Microsoft.Xna.Framework.Graphics.GraphicsDevice getGraphicsDevice()
public boolean getIsActive()
public boolean getIsMouseVisible()
public void setIsMouseVisible(boolean value)
value
- public GameWindow getWindow()
public GameServiceContainer getServices()
protected void BeginRun()
protected boolean BeginDraw()
public void Dispose()
Dispose
in interface System.IDisposable
protected void Dispose(boolean disposing)
disposing
- protected void Draw(GameTime gameTime)
gameTime
- protected void EndDraw()
public void Exit()
protected void finalize()
finalize
in class java.lang.Object
protected void Initialize()
protected void LoadContent()
public void ResetElapsedTime()
public void Run()
public void RunOneFrame()
public void Tick()
protected void UnloadContent()
protected void Update(GameTime gameTime)
gameTime
-