Crazy Eddie's GUI System
0.8.4
|
Dimension that has both a relative 'scale' portion and and absolute 'offset' portion. More...
Public Member Functions | |
UDim (float scale, float offset) | |
UDim (const UDim &v) | |
UDim | operator+ (const UDim &other) const |
UDim | operator- (const UDim &other) const |
UDim | operator* (const float val) const |
UDim | operator* (const UDim &other) const |
UDim | operator/ (const UDim &other) const |
const UDim & | operator+= (const UDim &other) |
const UDim & | operator-= (const UDim &other) |
const UDim & | operator*= (const UDim &other) |
const UDim & | operator/= (const UDim &other) |
bool | operator== (const UDim &other) const |
bool | operator!= (const UDim &other) const |
Static Public Member Functions | |
static UDim | zero () |
finger saving convenience method returning UDim(0, 0) | |
static UDim | relative () |
finger saving convenience method returning UDim(1, 0) | |
static UDim | percent () |
finger saving convenience method returning UDim(0.01, 0) | |
static UDim | px () |
finger saving convenience method returning UDim(0, 1) | |
Public Attributes | |
float | d_scale |
float | d_offset |
Friends | |
UDim | operator* (const float val, const UDim &u) |
std::ostream & | operator<< (std::ostream &s, const UDim &v) |
allows writing the udim to std ostream |
Dimension that has both a relative 'scale' portion and and absolute 'offset' portion.
UDims are used for both positioning and sizing (hence the name dimension).
The scale component describes the amount of dimension we take from the parent CEGUI::Element. The offset component describes the amount of pixels and is not dependent on any element in the tree.
{.cpp} UDim(0.5f, 0);
{.cpp} UDim(0, 100.0f);
{.cpp}
UDim(1.0f, -100.0f); // 100px to the left from the right edge of parent widget
{.cpp}
UDim(0.0f, 1.123456f); // perfectly valid UDim
Keep in mind that if you use such dimensions they will likely get pixel aligned before rendering. You can disable such behavior via Element::setPixelAligned.
static UDim CEGUI::UDim::percent | ( | ) | [inline, static] |
finger saving convenience method returning UDim(0.01, 0)
static UDim CEGUI::UDim::px | ( | ) | [inline, static] |
finger saving convenience method returning UDim(0, 1)
static UDim CEGUI::UDim::relative | ( | ) | [inline, static] |
finger saving convenience method returning UDim(1, 0)