C# Класс 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.
Наследование: UIElement
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Enabled bool
m_IsButtonClicked bool

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
ScaleToText ( ) : void

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

Описание методов

AddImage() публичный Метод

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.
Результат void

Draw() публичный Метод

public Draw ( SpriteBatch SBatch, float LayerDepth ) : void
SBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
LayerDepth float
Результат void

DrawBorder() публичный Метод

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.
Результат void

IsMouseOver() публичный Метод

public IsMouseOver ( InputHelper Input ) : bool
Input InputHelper
Результат bool

UIButton() публичный Метод

public UIButton ( AddButtonNode Node, ParserState State, UIScreen Screen ) : Files
Node UIParser.Nodes.AddButtonNode
State UIParser.ParserState
Screen UIScreen
Результат Files

UIButton() публичный Метод

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
Результат Files

Update() публичный Метод

public Update ( InputHelper Input, GameTime GTime ) : void
Input InputHelper
GTime Microsoft.Xna.Framework.GameTime
Результат void

Описание свойств

Enabled публичное свойство

Is this button enabled (I.E not greyed out?)
public bool Enabled
Результат bool

m_IsButtonClicked публичное свойство

public bool m_IsButtonClicked
Результат bool