#include <ui_rect.h>
|
void | HSplitMid (CUIRect *pTop, CUIRect *pBottom, float Spacing=0.0f) const |
|
void | HSplitTop (float Cut, CUIRect *pTop, CUIRect *pBottom) const |
|
void | HSplitBottom (float Cut, CUIRect *pTop, CUIRect *pBottom) const |
|
void | VSplitMid (CUIRect *pLeft, CUIRect *pRight, float Spacing=0.0f) const |
|
void | VSplitLeft (float Cut, CUIRect *pLeft, CUIRect *pRight) const |
|
void | VSplitRight (float Cut, CUIRect *pLeft, CUIRect *pRight) const |
|
void | Margin (vec2 Cut, CUIRect *pOtherRect) const |
|
void | Margin (float Cut, CUIRect *pOtherRect) const |
|
void | VMargin (float Cut, CUIRect *pOtherRect) const |
|
void | HMargin (float Cut, CUIRect *pOtherRect) const |
|
bool | Inside (vec2 Point) const |
|
void | Draw (ColorRGBA Color, int Corners, float Rounding) const |
|
void | Draw4 (ColorRGBA ColorTopLeft, ColorRGBA ColorTopRight, ColorRGBA ColorBottomLeft, ColorRGBA ColorBottomRight, int Corners, float Rounding) const |
|
vec2 | TopLeft () const |
|
vec2 | Size () const |
|
vec2 | Center () const |
|
|
float | x |
|
float | y |
|
float | w |
|
float | h |
|
◆ Center()
vec2 CUIRect::Center |
( |
| ) |
const |
|
inline |
Returns the center position of this CUIRect as a vec2.
- Returns
- Center position as vec2.
◆ Draw()
void CUIRect::Draw |
( |
ColorRGBA |
Color, |
|
|
int |
Corners, |
|
|
float |
Rounding |
|
) |
| const |
Fill background of this CUIRect.
- Note
- Example of filling a black half transparent background with 5px rounded edges on all sides
-
MyCuiRect.Draw(ColorRGBA(0.0f, 0.0f, 0.0f, 0.5f), IGraphics::CORNER_ALL, 5.0f);
-
Example of filling a red background with sharp edges
-
MyCuiRect.Draw(ColorRGBA(1.0f, 0.0f, 0.0f), IGraphics::CORNER_NONE, 0.0f);
- Parameters
-
◆ Draw4()
◆ HMargin()
void CUIRect::HMargin |
( |
float |
Cut, |
|
|
CUIRect * |
pOtherRect |
|
) |
| const |
Places pOtherRect inside this CUIRect applying Cut as the margin only on the horizontal axis.
- Parameters
-
◆ HSplitBottom()
void CUIRect::HSplitBottom |
( |
float |
Cut, |
|
|
CUIRect * |
pTop, |
|
|
CUIRect * |
pBottom |
|
) |
| const |
Splits 2 CUIRect inside this CUIRect.
The cut parameter determines the height of the bottom rect, so it allows more customization than HSplitMid.
This method doesn't check if Cut is bigger than this rect height.
- Parameters
-
Cut | The height of the pBottom rect. |
pTop | The rect that ends up at the top with a height equal to this CUIRect height minus Cut. |
pBottom | The rect that ends up at the bottom with a height equal to Cut. |
◆ HSplitMid()
void CUIRect::HSplitMid |
( |
CUIRect * |
pTop, |
|
|
CUIRect * |
pBottom, |
|
|
float |
Spacing = 0.0f |
|
) |
| const |
Splits 2 CUIRect inside this CUIRect horizontally. You can pass null pointers.
- Parameters
-
pTop | This rect will end up taking the top half of this CUIRect. |
pBottom | This rect will end up taking the bottom half of this CUIRect. |
Spacing | Total size of margin between split rects. |
◆ HSplitTop()
void CUIRect::HSplitTop |
( |
float |
Cut, |
|
|
CUIRect * |
pTop, |
|
|
CUIRect * |
pBottom |
|
) |
| const |
Splits 2 CUIRect inside this CUIRect.
The cut parameter determines the height of the top rect, so it allows more customization than HSplitMid.
This method doesn't check if Cut is bigger than this rect height.
- Parameters
-
Cut | The height of the pTop rect. |
pTop | The rect that ends up at the top with a height equal to Cut. |
pBottom | The rect that ends up at the bottom with a height equal to this rect minus the Cut. |
◆ Init()
static void CUIRect::Init |
( |
IGraphics * |
pGraphics | ) |
|
|
inlinestatic |
◆ Inside()
bool CUIRect::Inside |
( |
vec2 |
Point | ) |
const |
Checks whether a point is inside this CUIRect.
- Parameters
-
Point | The point's position. |
- Returns
- true iff the given point is inside this CUIRect.
◆ Margin() [1/2]
void CUIRect::Margin |
( |
float |
Cut, |
|
|
CUIRect * |
pOtherRect |
|
) |
| const |
Places pOtherRect inside this CUIRect with Cut as the margin.
- Parameters
-
◆ Margin() [2/2]
void CUIRect::Margin |
( |
vec2 |
Cut, |
|
|
CUIRect * |
pOtherRect |
|
) |
| const |
Places pOtherRect inside this CUIRect with Cut as the margin.
- Parameters
-
Cut | The margin as a vec2. The x component applies to the vertical axis. The y component applies to the horizontal axis. |
pOtherRect | The CUIRect to place inside this CUIRect. |
◆ Size()
vec2 CUIRect::Size |
( |
| ) |
const |
|
inline |
Returns the size of this CUIRect as a vec2.
- Returns
- Size as vec2.
◆ TopLeft()
vec2 CUIRect::TopLeft |
( |
| ) |
const |
|
inline |
Returns the top-left position of this CUIRect as a vec2.
- Returns
- Top-left position as vec2.
◆ VMargin()
void CUIRect::VMargin |
( |
float |
Cut, |
|
|
CUIRect * |
pOtherRect |
|
) |
| const |
Places pOtherRect inside this CUIRect applying Cut as the margin only on the vertical axis.
- Parameters
-
◆ VSplitLeft()
void CUIRect::VSplitLeft |
( |
float |
Cut, |
|
|
CUIRect * |
pLeft, |
|
|
CUIRect * |
pRight |
|
) |
| const |
Splits 2 CUIRect inside this CUIRect.
The cut parameter determines the width of the left rect, so it allows more customization than VSplitMid.
This method doesn't check if Cut is bigger than this rect width.
- Parameters
-
Cut | The width of the pLeft rect. |
pLeft | The rect that ends up at the left with a width equal to Cut. |
pRight | The rect that ends up at the right with a width equal to this rect minus the Cut. |
◆ VSplitMid()
void CUIRect::VSplitMid |
( |
CUIRect * |
pLeft, |
|
|
CUIRect * |
pRight, |
|
|
float |
Spacing = 0.0f |
|
) |
| const |
Splits 2 CUIRect inside this CUIRect vertically. You can pass null pointers.
- Parameters
-
pLeft | This rect will take up the left half of this CUIRect. |
pRight | This rect will take up the right half of this CUIRect. |
Spacing | Total size of margin between split rects. |
◆ VSplitRight()
void CUIRect::VSplitRight |
( |
float |
Cut, |
|
|
CUIRect * |
pLeft, |
|
|
CUIRect * |
pRight |
|
) |
| const |
Splits 2 CUIRect inside this CUIRect.
The cut parameter determines the width of the right rect, so it allows more customization than VSplitMid.
This method doesn't check if Cut is bigger than this rect width.
- Parameters
-
Cut | The width of the pRight rect. |
pLeft | The rect that ends up at the left with a width equal to this CUIRect width minus Cut. |
pRight | The rect that ends up at the right with a width equal to Cut. |
◆ s_pGraphics
The documentation for this class was generated from the following files: