C# Класс Gonzo.Elements.UIElement

UIElement is the base class for all UI related elements (UIButton, UIControl, UIDialog, UIImage, UILabel, UISlider, UITextEdit).
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
Image UIImage
Name string
TextDrawingColor Color
Tracking int
Visible bool

Защищенные свойства (Protected)

Свойство Тип Описание
m_Font Microsoft.Xna.Framework.Graphics.SpriteFont
m_HasFocus bool
m_ID int
m_KeyboardInput bool
m_Opaque bool
m_Parent UIElement
m_Screen UIScreen
m_Size Vector2

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

Метод Описание
Draw ( SpriteBatch SBatch, Rectangle SourceRect, float LayerDepth ) : void

Handles drawing logic for this UIElement.

Draw ( SpriteBatch SBatch, Rectangle SourceRect, float LayerDepth, Vector2 ScaleFactor ) : void

Handles drawing logic for this UIElement.

Draw ( SpriteBatch SBatch, float LayerDepth ) : void

Handles drawing logic for this UIElement.

GetLayerDepth ( LayerDepth Depth ) : float

Gets the value of the corresponding layer depth.

IsMouseOver ( InputHelper Input ) : bool

Returns true if the mouse is over this UIElement. Does NOT work for pixel-perfect collision.

MouseEvents ( InputHelper Helper ) : void

Mouse interacted with this UIElement.

UIElement ( UIScreen Screen, UIElement Parent = null, string Path = "" ) : System

Constructs a UIElement from a Screen instance and an optional UIElement that acts as a parent.

UIElement ( string Name, Vector2 Position, Vector2 Size, UIScreen Screen, UIElement Parent = null ) : System
Update ( InputHelper Helper, GameTime GTime ) : void

Handles update logic for this UIElement.

Защищенные методы

Метод Описание
PixelCheck ( InputHelper Input, int Width ) : bool

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

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

Handles drawing logic for this UIElement.
public Draw ( SpriteBatch SBatch, Rectangle SourceRect, float LayerDepth ) : void
SBatch Microsoft.Xna.Framework.Graphics.SpriteBatch A SpriteBatch instance.
SourceRect Microsoft.Xna.Framework.Rectangle A source rectangle, for controlling which part of this elenent's texture is drawn.
LayerDepth float Depth at which to draw, may be null.
Результат void

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

Handles drawing logic for this UIElement.
public Draw ( SpriteBatch SBatch, Rectangle SourceRect, float LayerDepth, Vector2 ScaleFactor ) : void
SBatch Microsoft.Xna.Framework.Graphics.SpriteBatch A SpriteBatch instance.
SourceRect Microsoft.Xna.Framework.Rectangle A source rectangle, for controlling which part of this elenent's texture is drawn.
LayerDepth float Depth at which to draw, may be null.
ScaleFactor Vector2 Scale at which to draw, may be null.
Результат void

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

Handles drawing logic for this UIElement.
public Draw ( SpriteBatch SBatch, float LayerDepth ) : void
SBatch Microsoft.Xna.Framework.Graphics.SpriteBatch A SpriteBatch instance.
LayerDepth float Depth at which to draw, may be null.
Результат void

GetLayerDepth() публичный статический Метод

Gets the value of the corresponding layer depth.
public static GetLayerDepth ( LayerDepth Depth ) : float
Depth LayerDepth The depth for which to retrieve a value.
Результат float

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

Returns true if the mouse is over this UIElement. Does NOT work for pixel-perfect collision.
public IsMouseOver ( InputHelper Input ) : bool
Input InputHelper
Результат bool

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

Mouse interacted with this UIElement.
public MouseEvents ( InputHelper Helper ) : void
Helper InputHelper InputHelper instance for input data.
Результат void

PixelCheck() защищенный Метод

protected PixelCheck ( InputHelper Input, int Width ) : bool
Input InputHelper
Width int
Результат bool

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

Constructs a UIElement from a Screen instance and an optional UIElement that acts as a parent.
public UIElement ( UIScreen Screen, UIElement Parent = null, string Path = "" ) : System
Screen UIScreen A Screen instance.
Parent UIElement (Optional) UIElement that acts as a parent.
Path string (Optional) Path to a UI script that will create this UI element.
Результат System

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

public UIElement ( string Name, Vector2 Position, Vector2 Size, UIScreen Screen, UIElement Parent = null ) : System
Name string
Position Vector2
Size Vector2
Screen UIScreen
Parent UIElement
Результат System

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

Handles update logic for this UIElement.
public Update ( InputHelper Helper, GameTime GTime ) : void
Helper InputHelper InputHelper instance for input data.
GTime Microsoft.Xna.Framework.GameTime
Результат void

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

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

public UIImage,Gonzo.Elements Image
Результат UIImage

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

public string Name
Результат string

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

public Color TextDrawingColor
Результат Color

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

public int Tracking
Результат int

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

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

m_Font защищенное свойство

protected SpriteFont,Microsoft.Xna.Framework.Graphics m_Font
Результат Microsoft.Xna.Framework.Graphics.SpriteFont

m_HasFocus защищенное свойство

protected bool m_HasFocus
Результат bool

m_ID защищенное свойство

protected int m_ID
Результат int

m_KeyboardInput защищенное свойство

protected bool m_KeyboardInput
Результат bool

m_Opaque защищенное свойство

protected bool m_Opaque
Результат bool

m_Parent защищенное свойство

protected UIElement,Gonzo.Elements m_Parent
Результат UIElement

m_Screen защищенное свойство

protected UIScreen m_Screen
Результат UIScreen

m_Size защищенное свойство

protected Vector2 m_Size
Результат Vector2