Midnight Blue Game and Engine
Public Member Functions | Properties | List of all members
MB2D.UI.Layout Class Reference

A container for UIElements used within a UIView. Used to divide the View into smaller segments and to move around a group of elements easily More...

Inheritance diagram for MB2D.UI.Layout:
Inheritance graph
Collaboration diagram for MB2D.UI.Layout:
Collaboration graph

Public Member Functions

 Layout (UIView parentView, int rows, int cols)
 Initializes a new instance of the T:MB2D.UI.Layout class. Divides the layouts rows and columns into an even cell size based of its parents size. More...
 
override void Update ()
 Update all elements contained within the layout. More...
 
override void Draw (SpriteBatch spriteBatch)
 Draws all elements contained within the layout and the layouts border to the window. More...
 
void Add (UIElement element, int atRow, int atCol, int rowSpan, int colSpan)
 Adds a new UIElement to the layout, setting its size relative to this layouts cell size More...
 
- Public Member Functions inherited from MB2D.UI.UIElement
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...
 

Properties

Texture2D BaseTexture [get, set]
 
- Properties inherited from MB2D.UI.UIElement
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...
 

Additional Inherited Members

- Protected Member Functions inherited from MB2D.UI.UIElement
 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...
 

Detailed Description

A container for UIElements used within a UIView. Used to divide the View into smaller segments and to move around a group of elements easily

Constructor & Destructor Documentation

§ Layout()

MB2D.UI.Layout.Layout ( UIView  parentView,
int  rows,
int  cols 
)
inline

Initializes a new instance of the T:MB2D.UI.Layout class. Divides the layouts rows and columns into an even cell size based of its parents size.

Parameters
rowsNumber of rows the layout has.
colsNumber of columns the layout has.

Member Function Documentation

§ Add()

void MB2D.UI.Layout.Add ( UIElement  element,
int  atRow,
int  atCol,
int  rowSpan,
int  colSpan 
)
inline

Adds a new UIElement to the layout, setting its size relative to this layouts cell size

Parameters
elementElement to add.
atRowRow position to add the element at.
atColColumn position to add the element at.
rowSpanNumber of rows the element should span.
colSpanNumber of columns the element should span.
Here is the call graph for this function:

§ Draw()

override void MB2D.UI.Layout.Draw ( SpriteBatch  spriteBatch)
inlinevirtual

Draws all elements contained within the layout and the layouts border to the window.

Parameters
spriteBatchSprite batch to draw to.

Reimplemented from MB2D.UI.UIElement.

§ Update()

override void MB2D.UI.Layout.Update ( )
inlinevirtual

Update all elements contained within the layout.

Implements MB2D.UI.UIElement.


The documentation for this class was generated from the following file: