30#include "CEGUI/Base.h"
35# pragma warning(disable : 4251)
39#define cegui_absdim(x) CEGUI::UDim(0,(x))
40#define cegui_reldim(x) CEGUI::UDim((x),0)
121 inline UDim operator*(
const float val)
const
126 inline friend UDim operator*(
const float val,
const UDim& u)
128 return UDim(
val * u.d_scale,
val * u.d_offset);
140 return UDim(
other.d_scale == 0.0f ? 0.0f : d_scale /
other.d_scale,
141 other.d_offset == 0.0f ? 0.0f : d_offset /
other.d_offset);
146 d_scale +=
other.d_scale;
147 d_offset +=
other.d_offset;
153 d_scale -=
other.d_scale;
154 d_offset -=
other.d_offset;
160 d_scale *=
other.d_scale;
161 d_offset *=
other.d_offset;
169 d_scale = (
other.d_scale == 0.0f ? 0.0f : d_scale /
other.d_scale);
170 d_offset = (
other.d_offset == 0.0f ? 0.0f : d_offset /
other.d_offset);
176 return d_scale ==
other.d_scale && d_offset ==
other.d_offset;
189 s <<
"CEGUI::UDim(" << v.d_scale <<
", " << v.d_offset <<
")";
198 return UDim(0.0f, 0.0f);
209 return UDim(1.0f, 0.0f);
220 return UDim(0.01f, 0.0f);
232 return UDim(0.0f, 1.0f);
277 d_bottom(b.d_bottom),
286 return ((d_top ==
rhs.d_top) &&
287 (d_left ==
rhs.d_left) &&
288 (d_bottom ==
rhs.d_bottom) &&
289 (d_right ==
rhs.d_right));
301 d_bottom =
rhs.d_bottom;
302 d_right =
rhs.d_right;
307 UBox operator*(
const float val)
const
310 d_top *
val, d_left *
val,
311 d_bottom *
val, d_right *
val);
317 d_top *
dim, d_left *
dim,
318 d_bottom *
dim, d_right *
dim);
324 d_top + b.d_top, d_left + b.d_left,
325 d_bottom + b.d_bottom, d_right + b.d_right);
349inline UDim TypeSensitiveZero<UDim>()
366inline UDim TypeSensitiveOne<UDim>()
Definition MemoryAllocatedObject.h:110
base class for properties able to do native set/get
Definition TypedProperty.h:50
Class encapsulating the 'Unified Box' - this is usually used for margin.
Definition UDim.h:251
Dimension that has both a relative 'scale' portion and and absolute 'offset' portion.
Definition UDim.h:94
static UDim px()
finger saving convenience method returning UDim(0, 1)
Definition UDim.h:230
static UDim relative()
finger saving convenience method returning UDim(1, 0)
Definition UDim.h:207
static UDim zero()
finger saving convenience method returning UDim(0, 0)
Definition UDim.h:196
static UDim percent()
finger saving convenience method returning UDim(0.01, 0)
Definition UDim.h:218
Main namespace for Crazy Eddie's GUI Library.
Definition arch_overview.dox:1
T TypeSensitiveZero()
allows you to get UDim(0, 0) if you pass UDim or just 0 if you pass anything else
Definition UDim.h:343
T TypeSensitiveOne()
allows you to get UDim::relative() if you pass UDim or just 1 if you pass anything else
Definition UDim.h:360
String CEGUIEXPORT operator+(const String &str1, const String &str2)
Return String object that is the concatenation of the given inputs.
bool CEGUIEXPORT operator!=(const String &str1, const String &str2)
Return true if String str1 is not equal to String str2.
bool CEGUIEXPORT operator==(const String &str1, const String &str2)
Return true if String str1 is equal to String str2.