My Project
|
position of the GUI object More...
#include <GUIPosition.h>
Classes | |
union | _relativity |
Public Types | |
enum | GUI_ALIGNMENT_TYPE { upper_left = 0, bottom_right, bottom_left, upper_right, center_top, center_bottom, center_left, center_right, center, middle_top, middle_bottom, middle_left, middle_right, fill } |
relative to 2D screen More... | |
enum | CGUIPosition_TYPE { relative_to_screen = 10, relative_to_3Dobject = 11, relative_to_parent = 12 } |
How the position of the GUI object is specified. More... | |
Public Member Functions | |
CGUIPosition (const RECT &rect_) | |
CGUIPosition (int x, int y, int width, int height) | |
void | SetWidth (int width) |
void | SetHeight (int height) |
void | SetDepth (float Depth) |
void | Update3DDepth (float Depth) |
updates the 3d object depth if the object is relative to 3d object It's used internally. More... | |
bool | IsNormalWidthHeight () const |
int | GetWidth () const |
int | GetHeight () const |
int | GetLeft () const |
int | GetTop () const |
void | SetLeft (int X) |
void | SetTop (int Y) |
float | GetDepth () const |
void | SetXY (int X, int Y) |
void | SetSize (int width, int height) |
void | Reposition (const char *alignment, int left, int top, int width, int height) |
reposition the control using the same parameter definition used when control is created. More... | |
int | SetAlignment (const char *alignment) |
"_lt": align to left top of the screen "_lb": align to left bottom of the screen "_ct": align to center of the screen "_ctt": align to center top of the screen "_ctb": align to center bottom of the screen "_ctl": align to center left of the screen "_ctr": align to center right of the screen "_rt": align to right top of the screen "_rb": align to right bottom of the screen "_mt": align to middle top "_ml": align to middle left "_mr": align to middle right "_mb": align to middle bottom "_fi": align to left top and right bottom. More... | |
void | CalculateAbsPosition (RECT *pOut, const RECT *pParentRect) const |
Get the standard position of pIn relative to pParentRect. More... | |
bool | IsRelativeTo3DObject () const |
bool | IsRelativeToParent () const |
bool | IsRelativeToScreen () const |
CGUIPosition_TYPE | GetPositionType () const |
void | SetPositionType (CGUIPosition_TYPE val) |
void | SetRelatveTo3DObject (const char *s3DObjectName, float fOffset=0.f) |
void | SetRelatveTo3DObject (CBaseObject *p3DObject, float fOffset=0.f) |
bool | Is3DObjectSpecified () const |
CBaseObject * | GetRelative3DObject (IScene *pScene=NULL) const |
Static Public Member Functions | |
static void | GetAbsPosition (RECT *pOut, const RECT *pParentRect, const CGUIPosition *pIn) |
same as CalculateAbsPosition | |
Public Attributes | |
RECT | rect |
internal value in absolute screen coordinates | |
union ParaEngine::CGUIPosition::_relativity | Relative |
std::string | m_s3DObjectName |
3d object name that this gui object is attached to. More... | |
int | m_n3DObjectID |
3d object id that this gui object is attached to. More... | |
Protected Attributes | |
CGUIPosition_TYPE | m_nPositionType |
relative to screen | relative to 3D scene object | |
float | m_fDepth |
position of the GUI object
How the position of the GUI object is specified.
It can be object in pure screen pixels (a rectangular), or in scaled screen coordinates (a percentage)
relative to 2D screen
Get the standard position of pIn relative to pParentRect.
pOut | [out]: output in standard rect |
pParentRect | [in]: the standard rect of the parent of pIn; |
pIn | [in]: any rect. |
void ParaEngine::CGUIPosition::Reposition | ( | const char * | alignment, |
int | left, | ||
int | top, | ||
int | width, | ||
int | height | ||
) |
reposition the control using the same parameter definition used when control is created.
see InitObject() for parameter definition.
int CGUIPosition::SetAlignment | ( | const char * | alignment | ) |
"_lt": align to left top of the screen "_lb": align to left bottom of the screen "_ct": align to center of the screen "_ctt": align to center top of the screen "_ctb": align to center bottom of the screen "_ctl": align to center left of the screen "_ctr": align to center right of the screen "_rt": align to right top of the screen "_rb": align to right bottom of the screen "_mt": align to middle top "_ml": align to middle left "_mr": align to middle right "_mb": align to middle bottom "_fi": align to left top and right bottom.
This is like fill in the parent window. the layout is given below:
_lt _mt _rt
_ml _ct _mr
_lb _mb _rb
void ParaEngine::CGUIPosition::Update3DDepth | ( | float | Depth | ) |
updates the 3d object depth if the object is relative to 3d object It's used internally.
If users want to modify the depth of the UI, use SetDepth() instead
int ParaEngine::CGUIPosition::m_n3DObjectID |
3d object id that this gui object is attached to.
std::string ParaEngine::CGUIPosition::m_s3DObjectName |
3d object name that this gui object is attached to.
If empty, m_n3DObjectID is used.