Property | Type | Description | |
---|---|---|---|
_callback | FlxButtonClick | ||
_initialized | bool | ||
_off | FlxSprite | ||
_offT | FlxText | ||
_on | FlxSprite | ||
_onT | FlxText | ||
_onToggle | bool | ||
_pressed | bool | ||
_sf |
Method | Description | |
---|---|---|
Destroy ( ) : void |
Called by the game state when state is changed (if this object belongs to the state)
|
|
FlxButton ( int x, int y, FlxButtonClick callback ) : Microsoft.Xna.Framework |
Creates a new
|
|
LoadGraphic ( FlxSprite image, FlxSprite imageHighlight ) : |
Set your own image as the button background.
|
|
LoadText ( FlxText text, FlxText textHighlight ) : |
Add a text label to the button.
|
|
Render ( |
||
Update ( ) : void |
Called by the game loop automatically, handles mouseover and click detection.
|
Method | Description | |
---|---|---|
visibility ( bool on ) : void |
Internal function for handling the visibility of the off and on graphics.
|
Method | Description | |
---|---|---|
OnMouseUp ( object sender, |
Internal function for handling the actual callback call (for UI thread dependent calls like
|
public FlxButton ( int x, int y, FlxButtonClick callback ) : Microsoft.Xna.Framework | ||
x | int | The X position of the button. |
y | int | The Y position of the button. |
callback | FlxButtonClick | The function to call whenever the button is clicked. |
return | Microsoft.Xna.Framework |
public LoadGraphic ( FlxSprite image, FlxSprite imageHighlight ) : |
||
image | FlxSprite | A FlxSprite object to use for the button background. |
imageHighlight | FlxSprite | A FlxSprite object to use for the button background when highlighted (optional). |
return |
public LoadText ( FlxText text, FlxText textHighlight ) : |
||
text | FlxText | A FlxText object to use to display text on this button (optional). |
textHighlight | FlxText | A FlxText object that is used when the button is highlighted (optional). |
return |
public Render ( |
||
spriteBatch | ||
return | void |
protected visibility ( bool on ) : void | ||
on | bool | Whether the button should be on or off. |
return | void |