UIElement Class Reference

Base class of rendering element. More...

Inheritance diagram for UIElement:
RootUIElement UIPrimitive UISprite

List of all members.

Public Member Functions

 UIElement ()
 Constructor.
void Dispose ()
 Frees the unmanaged resources held by this UIElement and child UIElements.
void SetPosition (float x, float y)
 Sets the position in the parent coordinate system.
void AddChildFirst (UIElement child)
 Adds a child element to the beginning.
void AddChildLast (UIElement child)
 Adds a child element to the end.
void InsertChildBefore (UIElement child, UIElement nextChild)
 Inserts a specified child element immediately before.
void InsertChildAfter (UIElement child, UIElement prevChild)
 Inserts a specified child element immediately after.
void RemoveChild (UIElement child)
 Deletes the specified child element.

Protected Member Functions

virtual void Dispose (bool disposing)
 Frees the unmanaged resources held by this UIElement and child UIElements.
virtual void DisposeSelf ()
 Frees the unmanaged resources held by this UIElement.
Texture2D GetTexture ()
 Obtains the texture.
virtual internal void SetupDrawState ()
 Sets the rendering status.
virtual internal void Render ()
 Renders an element.
virtual internal void SetupFinalAlpha ()
 Calculates the final alpha value.
internal void SetupSortValue ()
 Sets the value to use with Z sort.

Properties

float X [get, set]
 Obtains and sets the X coordinate in the parent coordinate system.
float Y [get, set]
 Obtains and sets the Y coordinate in the parent coordinate system.
float Alpha [get, set]
 Obtains and sets the transparency.
bool Visible [get, set]
 Obtains and sets whether to display.
TextureFilterMode TextureFilterMode [get, set]
 Obtains and sets the texture filter mode.
TextureWrapMode TextureWrapMode [get, set]
 Obtains and sets the texture wrap mode.
ImageAsset Image [get, set]
 Obtains and sets the image.
bool ZSort [get, set]
 Obtains and sets whether to Z sort.
UIElement Parent [get]
 Obtains the parent element.
IEnumerable< UIElementChildren [get]
 Obtains the child element.
BlendMode BlendMode [get, set]
 Obtains and sets the blend mode.
Matrix4 Transform3D [get, set]
 Obtains and sets the transformation matrix to the parent coordinate system.
float ZSortOffset [get, set]
 Obtains and sets the Z-sort offset.
bool Culling [get, set]
 Obtains and sets whether to perform culling.
ShaderType ShaderType [get, set]
 Obtains and sets the shader program.
Matrix4 LocalToWorld [get]
 Obtains the matrix to be converted from the local coordinate system to the world coordinate system.

Detailed Description

Base class of rendering element.

Constructs a scene graph below each widget.


Member Function Documentation

void AddChildFirst ( UIElement  child)

Adds a child element to the beginning.

Parameters:
childChild element to be added

Moves it to the beginning if it has already been added.

void AddChildLast ( UIElement  child)

Adds a child element to the end.

Parameters:
childChild element to be added

Moves it to the end if it has already been added.

virtual void Dispose ( bool  disposing) [protected, virtual]

Frees the unmanaged resources held by this UIElement and child UIElements.

Deletes itself from a parent UIElement and recursively calls DisposeSelf() for child UIElements. When implementing Dispose with a derivative class, override DisposeSelf().

Parameters:
disposingtrue when called from Dispose()
void Dispose ( )

Frees the unmanaged resources held by this UIElement and child UIElements.

Recursively frees this UIElement and all UIElements in and below its tree. Once Dispose() has been called for a UIElement, it cannot be reused. If objects that require Dispose have been created with UIElement derivative classes, DisposeSelf() must be overridden and Dispose must be called for them.

virtual void DisposeSelf ( ) [protected, virtual]

Frees the unmanaged resources held by this UIElement.

This method is recursively called from Dispose() for the child UIElements. If objects that require Dispose have been created with derivative classes, this method must be overridden and Dispose must be called for them.

Reimplemented in UIPrimitive, and UISprite.

Texture2D GetTexture ( ) [protected]

Obtains the texture.

Returns:
Textures
void InsertChildAfter ( UIElement  child,
UIElement  prevChild 
)

Inserts a specified child element immediately after.

Parameters:
childChild element to be inserted
prevChildChild element to come immediately before the child element to be inserted

Moves it immediately after the specified child element if it has already been added.

void InsertChildBefore ( UIElement  child,
UIElement  nextChild 
)

Inserts a specified child element immediately before.

Parameters:
childChild element to be inserted
nextChildChild element to come immediately after the child element to be inserted

Moves it immediately before the specified child element if it has already been added.

void RemoveChild ( UIElement  child)

Deletes the specified child element.

Parameters:
childChild element to be deleted
void SetPosition ( float  x,
float  y 
)

Sets the position in the parent coordinate system.

Parameters:
xX coordinate in the parent coordinate system
yY coordinate in the parent coordinate system

Property Documentation

float Alpha [get, set]

Obtains and sets the transparency.

(0 - 1) Multiplies the transparency by all child elements and displays it.

IEnumerable<UIElement> Children [get]

Obtains the child element.

Returns the enumerator that repetitively handles the collection.