#include <Box.h>

Public Types | |
| enum | Area { MARGIN = 0, BORDER = 1, PADDING = 2, CONTENT = 3, NUM_AREAS = 3 } |
| enum | Edge { TOP = 0, RIGHT = 1, BOTTOM = 2, LEFT = 3, NUM_EDGES = 4 } |
Public Member Functions | |
| Box () | |
| Initialises a zero-sized box. | |
| Box (const Vector2f &content) | |
| Initialises a box with a default content area and no padding, borders and margins. | |
| const Vector2f & | GetOffset () const |
| Vector2f | GetPosition (Area area=Box::CONTENT) const |
| Vector2f | GetSize (Area area=Box::CONTENT) const |
| void | SetOffset (const Vector2f &offset) |
| void | SetContent (const Vector2f &content) |
| void | SetEdge (Area area, Edge edge, float size) |
| float | GetEdge (Area area, Edge edge) const |
| float | GetCumulativeEdge (Area area, Edge edge) const |
| bool | operator== (const Box &rhs) const |
| bool | operator!= (const Box &rhs) const |
| const Vector2f & Rocket::Core::Box::GetOffset | ( | ) | const |
Returns the offset of this box. This will usually be (0, 0).
| Vector2f Rocket::Core::Box::GetPosition | ( | Area | area = Box::CONTENT |
) | const |
Returns the top-left position of one of the box's areas, relative to the top-left of the border area. This means the position of the margin area is likely to be negative.
| area[in] | The desired area. |
| Vector2f Rocket::Core::Box::GetSize | ( | Area | area = Box::CONTENT |
) | const |
Returns the size of one of the box's areas. This will include all inner areas.
| area[in] | The desired area. |
| void Rocket::Core::Box::SetOffset | ( | const Vector2f & | offset | ) |
Sets the offset of the box, relative usually to the owning element. This should only be set for auxiliary boxes of an element.
| offset[in] | The offset of the box from the primary box. |
| void Rocket::Core::Box::SetContent | ( | const Vector2f & | content | ) |
Sets the size of the content area.
| content[in] | The size of the new content area. |
| void Rocket::Core::Box::SetEdge | ( | Area | area, | |
| Edge | edge, | |||
| float | size | |||
| ) |
Sets the size of one of the edges of one of the box's outer areas.
| area[in] | The area to change. | |
| edge[in] | The area edge to change. | |
| size[in] | The new size of the area segment. |
| float Rocket::Core::Box::GetEdge | ( | Area | area, | |
| Edge | edge | |||
| ) | const |
Returns the size of one of the area edges.
| area[in] | The desired area. | |
| edge[in] | The desired edge. |
| float Rocket::Core::Box::GetCumulativeEdge | ( | Area | area, | |
| Edge | edge | |||
| ) | const |
Returns the cumulative size of one edge up to one of the box's areas.
| area[in] | The area to measure up to (and including). So, MARGIN will return the width of the margin, and PADDING will be the sum of the margin, border and padding. | |
| edge[in] | The desired edge. |
| bool Rocket::Core::Box::operator== | ( | const Box & | rhs | ) | const |
Compares the size of the content area and the other area edges.
| bool Rocket::Core::Box::operator!= | ( | const Box & | rhs | ) | const |
Compares the size of the content area and the other area edges.