Defines a UI object that can be contained within Views and Layouts, drawn, updated, and moved about
More...
|
void | SetRelativeSize (UIContent parent, Point at, Point span) |
| Sets the size of the element relative to its parent More...
|
|
void | SetRelativeSize (UIContent parent, int atRow, int atCol, int rowSpan, int colSpan) |
| Sets the size of the element relative to its parent More...
|
|
virtual void | Draw (SpriteBatch spriteBatch) |
| Draws the element to the window. Overriden in derived classes More...
|
|
abstract void | Update () |
| Update the elements state and handles input. Overriden in derived classes More...
|
|
|
| UIElement (int rows, int cols) |
| Initializes a new instance of the T:MB2D.UI.UIElement class. Sets default property values More...
|
|
void | DrawBorder (SpriteBatch spriteBatch) |
| Draws the elements border to the window. Skips sides that have color set to Color.Transparent More...
|
|
|
UIContent | Content [get] |
| Gets the UIContent of the element, only available in container elements More...
|
|
Vector2 | Size [get] |
| Gets the column and row count of the element More...
|
|
Rectangle | BoundingBox [get] |
| Gets the bounding box of this element More...
|
|
bool | Fill [get, set] |
| Gets or sets a value that indicates the element should be stretched or shrunk to fill its parents bounds exactly More...
|
|
Color | BackgroundColor [get, set] |
| Gets or sets the color of the elements background. More...
|
|
string | TextContent [get, set] |
| Gets or sets the string rendered by the element. More...
|
|
Color | TextColor [get, set] |
| Gets or sets the current color of the text. More...
|
|
SpriteFont | Font [get, set] |
| Gets or sets the font used in rendering the elements TextContent More...
|
|
bool | BorderDisplayed [get, set] |
| Gets or sets a value indicating whether this T:MB2D.UI.UIElement has itsborder displayed. More...
|
|
int | BorderWidth [get, set] |
| Gets or sets the width of the border. More...
|
|
Color | BorderColor [get, set] |
| Gets or sets the color of the border. More...
|
|
Color | BorderTopColor [get, set] |
| Gets or sets the color of the border top. More...
|
|
Color | BorderRightColor [get, set] |
| Gets or sets the color of the border right. More...
|
|
Color | BorderBottomColor [get, set] |
| Gets or sets the color of the border bottom. More...
|
|
Color | BorderLeftColor [get, set] |
| Gets or sets the color of the border left. More...
|
|
string | Tag [get, set] |
| Gets or sets the tag used to quickly access this element and uniquely identify it. More...
|
|
Defines a UI object that can be contained within Views and Layouts, drawn, updated, and moved about
§ UIElement()
MB2D.UI.UIElement.UIElement |
( |
int |
rows, |
|
|
int |
cols |
|
) |
| |
|
inlineprotected |
Initializes a new instance of the T:MB2D.UI.UIElement class. Sets default property values
- Parameters
-
rows | Number of rows this element should span - used only be used for container elements |
cols | Number of columns this element should span - used only be used for container elements. |
§ Draw()
virtual void MB2D.UI.UIElement.Draw |
( |
SpriteBatch |
spriteBatch | ) |
|
|
inlinevirtual |
§ DrawBorder()
void MB2D.UI.UIElement.DrawBorder |
( |
SpriteBatch |
spriteBatch | ) |
|
|
inlineprotected |
Draws the elements border to the window. Skips sides that have color set to Color.Transparent
- Parameters
-
spriteBatch | Sprite batch to draw the border to. |
§ SetRelativeSize() [1/2]
void MB2D.UI.UIElement.SetRelativeSize |
( |
UIContent |
parent, |
|
|
Point |
at, |
|
|
Point |
span |
|
) |
| |
|
inline |
Sets the size of the element relative to its parent
- Parameters
-
parent | Parent content to align to |
at | Position element should be set to |
span | Number of columns/rows the element should span. |
§ SetRelativeSize() [2/2]
void MB2D.UI.UIElement.SetRelativeSize |
( |
UIContent |
parent, |
|
|
int |
atRow, |
|
|
int |
atCol, |
|
|
int |
rowSpan, |
|
|
int |
colSpan |
|
) |
| |
|
inline |
Sets the size of the element relative to its parent
- Parameters
-
parent | Parent content to align to |
atRow | Row position the element should align to. |
atCol | Column position the element should align to. |
rowSpan | Number of rows in the parent the element should span. |
colSpan | Number of columns in the parent the element should span. |
§ Update()
abstract void MB2D.UI.UIElement.Update |
( |
| ) |
|
|
pure virtual |
§ BackgroundColor
Color MB2D.UI.UIElement.BackgroundColor |
|
getset |
Gets or sets the color of the elements background.
The color of the background.
§ BorderBottomColor
Color MB2D.UI.UIElement.BorderBottomColor |
|
getset |
Gets or sets the color of the border bottom.
The color of the border bottom.
§ BorderColor
Color MB2D.UI.UIElement.BorderColor |
|
getset |
Gets or sets the color of the border.
The color of the border. Resets all border sides' colors to this color.
§ BorderDisplayed
bool MB2D.UI.UIElement.BorderDisplayed |
|
getset |
Gets or sets a value indicating whether this T:MB2D.UI.UIElement has itsborder displayed.
true
if border should be displayed; otherwise, false
.
§ BorderLeftColor
Color MB2D.UI.UIElement.BorderLeftColor |
|
getset |
Gets or sets the color of the border left.
The color of the border left.
§ BorderRightColor
Color MB2D.UI.UIElement.BorderRightColor |
|
getset |
Gets or sets the color of the border right.
The color of the border right.
§ BorderTopColor
Color MB2D.UI.UIElement.BorderTopColor |
|
getset |
Gets or sets the color of the border top.
The color of the border top.
§ BorderWidth
int MB2D.UI.UIElement.BorderWidth |
|
getset |
Gets or sets the width of the border.
The width of the border.
§ BoundingBox
Rectangle MB2D.UI.UIElement.BoundingBox |
|
get |
Gets the bounding box of this element
The bounding box.
§ Content
Gets the UIContent of the element, only available in container elements
The content.
§ Fill
bool MB2D.UI.UIElement.Fill |
|
getset |
Gets or sets a value that indicates the element should be stretched or shrunk to fill its parents bounds exactly
true
if set to fill parent; otherwise, false
.
§ Font
SpriteFont MB2D.UI.UIElement.Font |
|
getset |
Gets or sets the font used in rendering the elements TextContent
The font.
§ Size
Vector2 MB2D.UI.UIElement.Size |
|
get |
Gets the column and row count of the element
The elements grid size.
§ Tag
string MB2D.UI.UIElement.Tag |
|
getset |
Gets or sets the tag used to quickly access this element and uniquely identify it.
The tag.
§ TextColor
Color MB2D.UI.UIElement.TextColor |
|
getset |
Gets or sets the current color of the text.
The text contents current color value.
§ TextContent
string MB2D.UI.UIElement.TextContent |
|
getset |
Gets or sets the string rendered by the element.
The content of the text.
The documentation for this class was generated from the following file: