public class DrawableGameComponent extends GameComponent implements IDrawable
Modifier and Type | Field and Description |
---|---|
System.Event<System.EventArgs> |
DrawOrderChanged
Raised when the DrawOrder property changes.
|
System.Event<System.EventArgs> |
VisibleChanged
Raised when the Visible property changes.
|
Disposed, EnabledChanged, UpdateOrderChanged
Constructor and Description |
---|
DrawableGameComponent(Game game)
Creates a new instance of DrawableGameComponent.
|
Modifier and Type | Method and Description |
---|---|
protected void |
Dispose(boolean disposing)
Releases the unmanaged resources used by the DrawableGameComponent and optionally releases the managed resources.
|
void |
Draw(GameTime gameTime)
Called when the DrawableGameComponent needs to be drawn.
|
int |
getDrawOrder()
Order in which the component should be drawn, relative to other components that are in the same GameComponentCollection.
|
Microsoft.Xna.Framework.Graphics.GraphicsDevice |
getGraphicsDevice()
The GraphicsDevice the DrawableGameComponent is associated with.
|
boolean |
getVisible()
Indicates whether Draw should be called.
|
void |
Initialize()
Initializes the component.
|
protected void |
LoadContent()
Called when graphics resources need to be loaded.
|
protected void |
OnDrawOrderChanged(java.lang.Object sender,
System.EventArgs e)
Called when the DrawOrder property changes.
|
protected void |
OnVisibleChanged(java.lang.Object sender,
System.EventArgs e)
Called when the Visible property changes.
|
void |
setDrawOrder(int value) |
void |
setVisible(boolean value) |
protected void |
UnloadContent()
Called when graphics resources need to be unloaded.
|
Dispose, getEnabled, getGame, getUpdateOrder, OnEnabledChanged, OnUpdateOrderChanged, setEnabled, setUpdateOrder, Update
public final System.Event<System.EventArgs> DrawOrderChanged
public final System.Event<System.EventArgs> VisibleChanged
public DrawableGameComponent(Game game)
game
- The Game that the game component should be attached to.public int getDrawOrder()
getDrawOrder
in interface IDrawable
public void setDrawOrder(int value)
public Microsoft.Xna.Framework.Graphics.GraphicsDevice getGraphicsDevice()
public boolean getVisible()
getVisible
in interface IDrawable
public void setVisible(boolean value)
protected void Dispose(boolean disposing)
Dispose
in class GameComponent
disposing
- true to release both managed and unmanaged resources; false to release only unmanaged resources.public void Initialize()
Initialize
in interface IGameComponent
Initialize
in class GameComponent
protected void LoadContent()
protected void OnDrawOrderChanged(java.lang.Object sender, System.EventArgs e)
sender
- The DrawableGameComponent.e
- Arguments to the DrawOrderChanged event.protected void OnVisibleChanged(java.lang.Object sender, System.EventArgs e)
sender
- The DrawableGameComponent.e
- Arguments to the DrawOrderChanged event.protected void UnloadContent()