Interface IDrawable
An interface for a drawable Game Component that is called by the GameBase class.
public interface IDrawable
- Extension Methods
Properties
DrawOrder
Gets the draw order relative to other Game Components. IDrawable components with a lower value are drawn first.
int DrawOrder { get; }
Property Value
Visible
Gets a value indicating whether the Game Component's Draw(GameTime) method should be called by Draw(GameTime).
bool Visible { get; }
Property Value
Methods
BeginDraw()
Starts the drawing of the Game Component. It prepares the drawable component for rendering and determines whether a following Draw(GameTime) and EndDraw() call should occur.
bool BeginDraw()
Returns
- bool
true if Draw(GameTime) should be called; false otherwise.
Draw(GameTime)
Draws the Game Component.
void Draw(GameTime gameTime)
Parameters
gameTimeGameTimeThe current timing information.
EndDraw()
Ends the drawing of the Game Component.
void EndDraw()
Remarks
This method must be preceeded by calls to Draw(GameTime) and BeginDraw().
Exceptions
- GraphicsDeviceException
The Game Device this Game Component is using to draw itself is not in a valid state to end drawing, or it is not available.
Events
DrawOrderChanged
Occurs when the DrawOrder property changes.
event EventHandler<EventArgs> DrawOrderChanged
Event Type
VisibleChanged
Occurs when the Visible property changes.
event EventHandler<EventArgs> VisibleChanged