C# Class Gonzo.Elements.UIElement

UIElement is the base class for all UI related elements (UIButton, UIControl, UIDialog, UIImage, UILabel, UISlider, UITextEdit).
ファイルを表示 Open project: Afr0Games/Project-Dollhouse Class Usage Examples

Public Properties

Property Type Description
Image UIImage
Name string
TextDrawingColor Color
Tracking int
Visible bool

Protected Properties

Property Type Description
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

Public Methods

Method Description
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.

Protected Methods

Method Description
PixelCheck ( InputHelper Input, int Width ) : bool

Method Details

Draw() public method

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.
return void

Draw() public method

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.
return void

Draw() public method

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.
return void

GetLayerDepth() public static method

Gets the value of the corresponding layer depth.
public static GetLayerDepth ( LayerDepth Depth ) : float
Depth LayerDepth The depth for which to retrieve a value.
return float

IsMouseOver() public method

Returns true if the mouse is over this UIElement. Does NOT work for pixel-perfect collision.
public IsMouseOver ( InputHelper Input ) : bool
Input InputHelper
return bool

MouseEvents() public method

Mouse interacted with this UIElement.
public MouseEvents ( InputHelper Helper ) : void
Helper InputHelper InputHelper instance for input data.
return void

PixelCheck() protected method

protected PixelCheck ( InputHelper Input, int Width ) : bool
Input InputHelper
Width int
return bool

UIElement() public method

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.
return System

UIElement() public method

public UIElement ( string Name, Vector2 Position, Vector2 Size, UIScreen Screen, UIElement Parent = null ) : System
Name string
Position Vector2
Size Vector2
Screen UIScreen
Parent UIElement
return System

Update() public method

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
return void

Property Details

Image public_oe property

public UIImage,Gonzo.Elements Image
return UIImage

Name public_oe property

public string Name
return string

TextDrawingColor public_oe property

public Color TextDrawingColor
return Color

Tracking public_oe property

public int Tracking
return int

Visible public_oe property

public bool Visible
return bool

m_Font protected_oe property

protected SpriteFont,Microsoft.Xna.Framework.Graphics m_Font
return Microsoft.Xna.Framework.Graphics.SpriteFont

m_HasFocus protected_oe property

protected bool m_HasFocus
return bool

m_ID protected_oe property

protected int m_ID
return int

m_KeyboardInput protected_oe property

protected bool m_KeyboardInput
return bool

m_Opaque protected_oe property

protected bool m_Opaque
return bool

m_Parent protected_oe property

protected UIElement,Gonzo.Elements m_Parent
return UIElement

m_Screen protected_oe property

protected UIScreen m_Screen
return UIScreen

m_Size protected_oe property

protected Vector2 m_Size
return Vector2