C# Class Gonzo.Elements.UIButton

A clickable button that can trigger an event. A button is always graphically represented by four equally sized frames in a texture.
Inheritance: UIElement
Afficher le fichier Open project: Afr0Games/Project-Dollhouse Class Usage Examples

Méthodes publiques

Свойство Type Description
Enabled bool
m_IsButtonClicked bool

Méthodes publiques

Méthode Description
AddImage ( UIImage Img ) : void

Adds an image to this button, because (you guessed it) sometimes buttons will be defined without images...

Draw ( SpriteBatch SBatch, float LayerDepth ) : void
DrawBorder ( SpriteBatch SBatch, Rectangle rectangleToDraw, int thicknessOfBorder, Microsoft.Xna.Framework.Color borderColor ) : void

Draws a border around this button, for debugging purposes.

IsMouseOver ( InputHelper Input ) : bool
UIButton ( AddButtonNode Node, ParserState State, UIScreen Screen ) : Files
UIButton ( string Name, Microsoft.Xna.Framework.Graphics.Texture2D Tex, Vector2 Pos, UIScreen Screen, UIElement Parent = null ) : Files

Constructs a new UIButton instance.

Update ( InputHelper Input, GameTime GTime ) : void

Private Methods

Méthode Description
ScaleToText ( ) : void

Scales a button to the size of the button's text. Also repositions a button's text according to the new size.

Method Details

AddImage() public méthode

Adds an image to this button, because (you guessed it) sometimes buttons will be defined without images...
public AddImage ( UIImage Img ) : void
Img UIImage The image to add.
Résultat void

Draw() public méthode

public Draw ( SpriteBatch SBatch, float LayerDepth ) : void
SBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
LayerDepth float
Résultat void

DrawBorder() public méthode

Draws a border around this button, for debugging purposes.
public DrawBorder ( SpriteBatch SBatch, Rectangle rectangleToDraw, int thicknessOfBorder, Microsoft.Xna.Framework.Color borderColor ) : void
SBatch Microsoft.Xna.Framework.Graphics.SpriteBatch A Spritebatch to draw with.
rectangleToDraw Microsoft.Xna.Framework.Rectangle A rectangle that will make up the border.
thicknessOfBorder int Thickness of border to be drawn.
borderColor Microsoft.Xna.Framework.Color Color of border.
Résultat void

IsMouseOver() public méthode

public IsMouseOver ( InputHelper Input ) : bool
Input InputHelper
Résultat bool

UIButton() public méthode

public UIButton ( AddButtonNode Node, ParserState State, UIScreen Screen ) : Files
Node UIParser.Nodes.AddButtonNode
State UIParser.ParserState
Screen UIScreen
Résultat Files

UIButton() public méthode

Constructs a new UIButton instance.
public UIButton ( string Name, Microsoft.Xna.Framework.Graphics.Texture2D Tex, Vector2 Pos, UIScreen Screen, UIElement Parent = null ) : Files
Name string Name of button.
Tex Microsoft.Xna.Framework.Graphics.Texture2D Texture used to display this button.
Pos Microsoft.Xna.Framework.Vector2
Screen UIScreen This button's screen.
Parent UIElement
Résultat Files

Update() public méthode

public Update ( InputHelper Input, GameTime GTime ) : void
Input InputHelper
GTime Microsoft.Xna.Framework.GameTime
Résultat void

Property Details

Enabled public_oe property

Is this button enabled (I.E not greyed out?)
public bool Enabled
Résultat bool

m_IsButtonClicked public_oe property

public bool m_IsButtonClicked
Résultat bool