|
| 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 |
|
Dimension that has both a relative 'scale' portion and and absolute 'offset' portion.
- The meaning of this class depends on where you use it, it is just a float tuple. We will only describe the usual usecase for CEGUI::Window position and size. CEGUI::Window gets that behavior from CEGUI::Element.
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.
- Example: 50% of parent's width
- Example: 100px
- Negative components
- You can use negative components in UDim and they are in fact very useful!
- Floating point
- Both components are floats, that means that expressing fractions of pixels is allowed even though such construct goes against the definition of pixel.
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.
- See Also
- CEGUI::UVector2
-
CEGUI::USize
-
CEGUI::URect