Public Member Functions | |
ParaUIObject (CGUIBase *obj) | |
bool | IsValid () |
check if the object is valid | |
void | AddChild (ParaUIObject pChild) |
Attach a child GUI object to this object This function is only for container objects;. | |
ParaAttributeObject | GetAttributeObject () |
get the attribute object associated with an object. | |
void | GetAttributeObject_ (ParaAttributeObject &output) |
for API exportation | |
void | AddTextItem (const char *text) |
Add a text item for listbox. | |
void | AttachToRoot () |
Attach this object to the root of the screen GUI. | |
void | SetName (const char *szName) |
string | GetName () const |
Get the name of this object. | |
ParaUIObject | GetChild (const char *name) |
get child by name | |
ParaUIObject | GetChildAt (int index) |
get child by index.Index start from 0. | |
int | GetChildCount () |
get the total number of child UI objects. | |
int | GetID () const |
get id of this object. | |
void | SetID (int nID) |
this function is used internally. | |
ParaUIObject | GetChildByID (int nChildID) |
get a child node by its id | |
ParaUIObject | GetChildByName (const char *name) |
get the first child node whose name is name. | |
void | SetEnabled (bool bEnabled) |
Set if a control is enabled. | |
bool | GetEnabled () const |
void | SetUseTextShadow (bool bUseTextShadow) |
Set/Get whether the use text shadow. | |
bool | GetUseTextShadow () const |
void | SetHighlightStyle (const char *style) |
const char * | GetHighlightStyle () const |
string | GetColor () const |
Get the UI control color for the current state. | |
void | SetColor (const char *strColor) |
set the UI control color for the current state. | |
void | SetAutoSize (bool bAutosize) |
Set if a control is auto resize. | |
bool | GetAutoSize () const |
void | GetTextLineSize (int *width, int *height) |
get the text line size in pixels, supposing the current font and text will be rendered in a single line. | |
void | SetVisible (bool bVisible) |
Set if a control is visible. | |
bool | GetVisible () const |
bool | GetScrollable () const |
string | GetType () const |
void | SetReceiveDrag (bool bReceiveDrag) |
Get the resource of this control. | |
bool | GetReceiveDrag () const |
ParaUIObject | GetParent () const |
void | SetParent (ParaUIObject parent) |
void | SetDefault (bool bDefaultButton) |
set as the default button of the container. | |
void | SetLifeTime (int nSeconds) |
Set a count down timer in frames. | |
int | GetLifeTime () const |
Get a count down timer in frames. | |
string | GetText () const |
Get text of a control;. | |
void | SetText3 (const char *strText, const char *strColor, const char *strFontAssetName) |
Show text in the window. | |
void | SetText1 (const char *strText) |
void | SetPasswordChar (string PasswordChar) |
this function is only supported in the "editbox" control, not the "text" or "IMEEditbox" The PasswordChar property specifies the character displayed in the edit box. | |
string | GetPasswordChar () const |
get password char | |
void | SetTopLevel (bool value) |
Set a container to be a top-level control or set a top-level control back to normal container. | |
void | SetBGImage1 (const char *szBackground) |
szBackground can be filename[; left top width height][:left top toright to bottom], such as "texture/whitedot.png", "texture/whitedot.png;0 0 64 64", "texture/whitedot.png:10 10 10 10", "texture/whitedot.png;0 0 64 64;10 10 10 10" [:left top toright to bottom] is used to specify the inner rect of the center tile in a nine texture element UI object | |
void | SetBGImage5 (const char *TextFilename, int left, int top, int width, int height) |
void | SetBGImage (ParaAssetObject pTextureEntity) |
void | SetBGImageAndRect (ParaAssetObject pTextureEntity, int left, int top, int width, int height) |
void | SetBGImage_ (TextureEntity *pTextureEntity, RECT *rect) |
void | SetBGImage2 (const char *TextFilename, RECT *rect) |
string | GetBGImage () const |
void | SetBtnImage2 (const char *TextFilename, RECT *rect) |
void | SetBtnImage1 (const char *szButton) |
string | GetBtnImage () const |
void | SetNineElementBG (const char *TextFilename, int left, int top, int toRight, int toBottom) |
drawing the background using nine element. | |
int | GetFirstVisibleCharIndex () |
this method is only valid if the control is edit box or imeedit box if the text is longer than the edit box, the returned value is the index of the first visible character in the edit box Normally, this is 0 if the text can be fully contained in the edit box. | |
int | GetCaretPosition () |
return Caret position in characters | |
void | SetCaretPosition (int nCharacterPos) |
Set Caret position in characters. | |
int | GetTextSize () |
return the text size in Unicode character count. | |
void | GetPriorWordPos (int nCP, int &Prior) |
get the prior word position | |
void | GetNextWordPos (int nCP, int &Next) |
get the next word position | |
void | CPtoXY (int nCP, bool bTrail, int &X, int &Y) |
Character position to X,Y in pixel. | |
void | XYtoCP (int nX, int nY, int &CP, int &nTrail) |
X,Y in pixel to character position. | |
void | SetPageSize (int pagesize) |
Get the page size of the scroll bar Page size is the size of how many items a page contains. | |
void | SetStep (int nDelta) |
how many pixels to scroll each step | |
int | GetStep () |
how many pixels to scroll each step | |
void | SetTrackRange (int nBegin, int nEnd) |
set the page size of a container or a scroll bar | |
void | GetTrackRange (int &nBegin, int &nEnd) |
int | GetAnimationStyle () const |
get the animation style of this object. | |
void | SetAnimationStyle (int nStyle) |
set the animation style of this object. | |
void | SetScrollable (bool bScrollable) |
Set if a container is scrollable. | |
void | GetAbsPosition (float &x, float &y, float &width, float &height, float &z) const |
get the absolute position of the control in screen coordinate e.g. | |
void | SetPosition (const char *pos) |
set rect position of the control. | |
string | GetPosition () const |
get rect position of the control | |
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. | |
int | GetValue () const |
Gets and Sets the value of a control Controls that have value are CGUIScrollBar, CGUISlider. | |
void | SetValue (int value) |
void | OnClick (const char *strScriptName) |
When the user clicked on the window, the script file or function will be activated. | |
string | GetOnClick () const |
void | OnSize (const char *strScriptName) |
called when the size of the window is changed. | |
string | GetOnSize () const |
void | OnActivate (const char *strScriptName) |
called when the size of the window is changed. | |
string | GetOnActivate () const |
void | OnDoubleClick (const char *strScriptName) |
The following parameters are passed as global variables. | |
string | GetOnDoubleClick () const |
void | OnKeyDown (const char *strScriptName) |
When the user pressed a key while the mouse cursor is inside the window, a script file or function will be activated. | |
string | GetOnKeyDown () const |
void | OnKeyUp (const char *strScriptName) |
string | GetOnKeyUp () const |
void | OnDragBegin (const char *strScriptName) |
string | GetOnDragBegin () const |
void | OnDragEnd (const char *strScriptName) |
string | GetOnDragEnd () const |
void | OnDragOver (const char *strScriptName) |
string | GetOnDragOver () const |
void | OnMouseMove (const char *strScriptName) |
string | GetOnMouseMove () const |
void | OnMouseHover (const char *strScriptName) |
string | GetOnMouseHover () const |
void | OnMouseEnter (const char *strScriptName) |
string | GetOnMouseEnter () const |
void | OnMouseLeave (const char *strScriptName) |
string | GetOnMouseLeave () const |
void | OnMouseDown (const char *strScriptName) |
string | GetOnMouseDown () const |
void | OnMouseUp (const char *strScriptName) |
string | GetOnMouseUp () const |
void | OnMouseWheel (const char *strScriptName) |
string | GetOnMouseWheel () const |
void | OnFrameMove (const char *strScriptName) |
string | GetOnFrameMove () const |
void | SetCursor (const char *szCursorFile) |
Set/Get cusor file when mouse is over it. | |
string | GetCursor () const |
void | OnChange (const char *strScriptName) |
usually the editbox will call this handle, "virtual_key" contains the last key stroke. | |
string | GetOnChange () const |
void | OnSelect (const char *strScriptName) |
string | GetOnSelect () const |
void | OnModify (const char *strScriptName) |
string | GetOnModify () const |
void | SetCanDrag (bool bCanDrag) |
bool | GetCanDrag () const |
void | SetFontString1 (const char *font) |
void | SetFontString3 (const char *fontname, DWORD fontsize, bool isbold) |
string | ToScript () const |
string | GetFontString () const |
void | Focus () |
void | LostFocus () |
bool | GetReadOnly () const |
void | SetReadOnly (bool readonly) |
int | GetX () const |
int | GetY () const |
float | GetDepth () const |
void | SetDepth (float depth) |
void | SetX (int x) |
void | SetY (int y) |
void | SetWidth (int width) |
void | SetHeight (int height) |
int | Width () const |
int | Height () const |
void | SetSize (int width, int height) |
void | SetRotation (float fRot) |
set the rotation of the control around the center of the UI plus rotation origin offset. | |
float | GetRotation () const |
Get the rotation of the control around the center of the UI plus rotation origin offset. | |
void | SetRotOriginOffset (float x, float y) |
rotation origin offset from the center of the UI object. | |
void | GetRotOriginOffset (float *x, float *y) const |
rotation origin offset from the center of the UI object. | |
void | SetScaling (float x, float y) |
set the scaling of the control around the center of the UI plus rotation origin offset. | |
void | GetScaling (float *x, float *y) const |
Get the scaling of the control around the center of the UI plus rotation origin offset. | |
void | SetScalingX (float x) |
float | GetScalingX () const |
void | SetScalingY (float y) |
float | GetScalingY () const |
void | SetTranslation (float x, float y) |
set the translation of the control around the center of the UI plus rotation origin offset. | |
void | GetTranslation (float *x, float *y) const |
Get the translation of the control around the center of the UI plus rotation origin offset. | |
void | SetTranslationX (float x) |
float | GetTranslationX () const |
void | SetTranslationY (float y) |
float | GetTranslationY () const |
void | SetSpacing (int nSpacing) |
Spacing between the text and the edge of border. | |
int | GetSpacing () const |
Spacing between the text and the edge of border. | |
int | GetScrollbarWidth () const |
void | SetScrollbarWidth (int width) |
bool | GetFixedThumb () const |
void | SetFixedThumb (bool bFixed) |
int | GetThumbSize () const |
void | SetThumbSize (int size) |
void | SetBindingObj (ParaUIObject obj) |
void | SetFastRender (bool fastrender) |
bool | GetFastRender () const |
bool | GetWordbreak () const |
void | SetWordbreak (bool wordbreak) |
int | GetItemHeight () const |
void | SetItemHeight (int itemheight) |
bool | GetMultipleSelect () const |
void | SetMultipleSelect (bool multiple) |
void | AttachTo3D (const ParaObject obj) |
Attach the control to the 3D object. | |
void | AttachTo3D_ (const char *s3DObjectName) |
save as AttachTo3D, except that the 3D object's name is specified. | |
string | GetToolTip () const |
void | SetToolTip (const char *tooltip) |
void | RemoveAll () |
void | RemoveItem (int index) |
void | SetPopUp (int popup) |
int | GetPopUp () const |
ParaUIFont | CreateFont (const char *name, const char *fontname) |
ParaUITexture | CreateTexture (const char *name, const char *texturename) |
ParaUIFont | GetFont (const char *name) |
void | DoAutoSize () |
try to automatically adjust the size of this object to contain all its content. | |
ParaUITexture | GetTexture (const char *name) |
Get the texture object associated with the current control A control may be associated with multiple textures. | |
bool | LoadFile (const char *szFilename) |
void | PlayVideo () |
void | StopVideo () |
void | PauseVideo () |
bool | SeekVideo (double seekvalue) |
double | GetVideoDuration () |
double | GetVideoPos () |
void | BringToFront () |
bring to front among the same z order | |
void | BringToBack () |
bring to back among the same z order | |
int | GetZOrder () const |
z order affect the order of rendering. | |
void | SetZOrder (int nOrder) |
z order affect the order of rendering. | |
bool | IsModified () const |
void | SetActiveLayer (const char *layer) |
Set the active layer for setting resource;. | |
bool | HasLayer (const char *layer) |
return whether a given layer exist in the resource. | |
void | SetCurrentState (const char *statename) |
Set the current state for setting resource:. | |
void | CloneState (const char *statename) |
Clones a state to the current state. | |
void | ActivateScript (const char *scripttype) |
void | SetCanvasIndex (int index) |
int | GetCanvasIndex () const |
void | InvalidateRect () |
the window's client(child) area that must be recalculated and redrawn this function is obsoleted, call UpdateRect() instead | |
void | UpdateRect () |
recalculated the window's client rect | |
Public Attributes | |
CGUIBase * | m_pObj |
Protected Member Functions | |
string | GenGetImage (int index) const |
string | GenGetFont (int index) const |
bool ParaScripting::ParaUIObject::IsValid | ( | ) |
check if the object is valid
void ParaScripting::ParaUIObject::AddChild | ( | ParaUIObject | pChild | ) |
Attach a child GUI object to this object This function is only for container objects;.
pChild,: | the child object to be attached |
ParaAttributeObject ParaScripting::ParaUIObject::GetAttributeObject | ( | ) |
get the attribute object associated with an object.
void ParaScripting::ParaUIObject::AddTextItem | ( | const char * | text | ) |
Add a text item for listbox.
text,: | the text string to be added. |
ParaUIObject ParaScripting::ParaUIObject::GetChildAt | ( | int | index | ) |
get child by index.Index start from 0.
Use GetChildCount() for total child count.
int ParaScripting::ParaUIObject::GetChildCount | ( | ) |
get the total number of child UI objects.
int ParaScripting::ParaUIObject::GetID | ( | ) | const |
get id of this object.
please note that this is a child id, not a globally unique id. the id is only available when this object is attached to a parent. And the ID will change if this object changes its parent. In all other circumstances, the id uniquely identify this object in its parent. One can call GetChildByID() from its parent control to get this object. _Note_: ID is assigned by its parent when this control is attached to a parent control (or parent changes) it ensures that ChildID is unique among all sibling children of the parent control during the lifetime of the parent.
void ParaScripting::ParaUIObject::SetID | ( | int | nID | ) |
this function is used internally.
never call this unless you known why.
ParaScripting::ParaUIObject ParaScripting::ParaUIObject::GetChildByID | ( | int | nChildID | ) |
get a child node by its id
nChildID,: | child ID usually obtained by GetID() method. |
ParaScripting::ParaUIObject ParaScripting::ParaUIObject::GetChildByName | ( | const char * | name | ) |
get the first child node whose name is name.
Since a name may not be unique among its sibling children. One is advised to use GetChildByID() instead.
name,: | child name usually obtained by GetName() method. |
void ParaScripting::ParaUIObject::SetEnabled | ( | bool | bEnabled | ) |
Set if a control is enabled.
bEnabled,: | the new value |
string ParaScripting::ParaUIObject::GetColor | ( | ) | const |
Get the UI control color for the current state.
void ParaScripting::ParaUIObject::SetColor | ( | const char * | strColor | ) |
set the UI control color for the current state.
strColor:"255 | 0 0" or "255 0 0 128" |
void ParaScripting::ParaUIObject::SetAutoSize | ( | bool | bAutosize | ) |
Set if a control is auto resize.
bAutosize,: | the new value |
void ParaScripting::ParaUIObject::GetTextLineSize | ( | int * | width, | |
int * | height | |||
) |
get the text line size in pixels, supposing the current font and text will be rendered in a single line.
void ParaScripting::ParaUIObject::SetVisible | ( | bool | bVisible | ) |
Set if a control is visible.
bVisible,: | the new value |
void ParaScripting::ParaUIObject::SetDefault | ( | bool | bDefaultButton | ) |
set as the default button of the container.
please note each container can only have one default button. so as one set a default button, it will automatically unset old default button in the parent container. when enter key is pressed in an edit box, the default button will be clicked.
void ParaScripting::ParaUIObject::SetLifeTime | ( | int | nSeconds | ) |
Set a count down timer in frames.
when it is zero, the object will be automatically deleted If LifeTime is negative, the object will be permanent.
nSeconds,: | how many seconds the window left to be alive. |
int ParaScripting::ParaUIObject::GetLifeTime | ( | ) | const |
Get a count down timer in frames.
when it is zero, the object will be automatically deleted If LifeTime is negative, the object will be permanent.
void ParaScripting::ParaUIObject::SetText3 | ( | const char * | strText, | |
const char * | strColor, | |||
const char * | strFontAssetName | |||
) |
Show text in the window.
The text will fill the entire window. If one want to position text in a window, it must create another window to contain the text, then use the window to position the text.
strText,: | text to display | |
strColor,: | color of the object. such as "255 255 255". | |
strFontAssetName,: | the font asset name, it can be "", in which case the default font will be used. |
void ParaScripting::ParaUIObject::SetPasswordChar | ( | string | PasswordChar | ) |
this function is only supported in the "editbox" control, not the "text" or "IMEEditbox" The PasswordChar property specifies the character displayed in the edit box.
For example, if you want asterisks displayed in the password box, specify * for the PasswordChar property in the Properties window. Then, regardless of what character a user types in the text box, an asterisk is displayed.
PasswordChar | such as '*' |
void ParaScripting::ParaUIObject::SetBGImage1 | ( | const char * | szBackground | ) |
szBackground can be filename[; left top width height][:left top toright to bottom], such as "texture/whitedot.png", "texture/whitedot.png;0 0 64 64", "texture/whitedot.png:10 10 10 10", "texture/whitedot.png;0 0 64 64;10 10 10 10" [:left top toright to bottom] is used to specify the inner rect of the center tile in a nine texture element UI object
szBackground,: | the texture asset file name with the rectangle information the format of szBackground is filename[; left top width height][:left top toright to bottom]. if it is "" or width or height is zero, the texture is not drawn or is fully transparent. e.g. "texture/whitedot.png", "texture/whitedot.png;0 0 64 64", "texture/whitedot.png:10 10 10 10", "texture/whitedot.png;0 0 64 64;10 10 10 10" [:left top toright to bottom] is used to specify the inner rect of the center tile in a nine texture element UI object |
void ParaScripting::ParaUIObject::SetNineElementBG | ( | const char * | TextFilename, | |
int | left, | |||
int | top, | |||
int | toRight, | |||
int | toBottom | |||
) |
drawing the background using nine element.
TextFilename,: | the background texture to use. it will be divided into 3x3 tiles when drawing the control | |
left,top,toRight,toBottom,: | the inner tile position relative to the dimension of TextFilename texture. If all are 0, it will be set back to one element background |
void ParaScripting::ParaUIObject::SetCaretPosition | ( | int | nCharacterPos | ) |
Set Caret position in characters.
nCharacterPos,: | in characters |
void ParaScripting::ParaUIObject::SetPageSize | ( | int | pagesize | ) |
Get the page size of the scroll bar Page size is the size of how many items a page contains.
The control will scroll a page size if we click on the empty space of the track of the scroll bar
void ParaScripting::ParaUIObject::SetTrackRange | ( | int | nBegin, | |
int | nEnd | |||
) |
set the page size of a container or a scroll bar
nBegin,: | the start value of the range | |
nEnd,: | the end value of the range |
int ParaScripting::ParaUIObject::GetAnimationStyle | ( | ) | const |
get the animation style of this object.
Different GUI object may have different style definitions. for "button" object: 1 is gradually enlarge 5% when getting focus.2 is 10%, 3 is 15%, 4 is 20%, 5 is 25%
void ParaScripting::ParaUIObject::SetAnimationStyle | ( | int | nStyle | ) |
set the animation style of this object.
Different GUI object may have different style definitions. for "button" object: 1 is gradually enlarge 5% when getting focus.2 is 10%, 3 is 15%, 4 is 20%, 5 is 25%
nStyle,: | 0 always means no animation. 1 is gradually enlarge 5% when getting focus.2 is 10%, 3 is 15%, 4 is 20%, 5 is 25% 11-15 means the same as 1-5, except that the normal state alpha is the same as the highlighted state. 21-25 means the same as 11-15, except that the button animation will not stop in the highlighted state. |
void ParaScripting::ParaUIObject::SetScrollable | ( | bool | bScrollable | ) |
Set if a container is scrollable.
bScrollable,: | the new scrollable value |
void ParaScripting::ParaUIObject::GetAbsPosition | ( | float & | x, | |
float & | y, | |||
float & | width, | |||
float & | height, | |||
float & | z | |||
) | const |
get the absolute position of the control in screen coordinate e.g.
local x,y = obj:GetAbsPosition();
&x | screen x | |
&y | screen y | |
&width | width | |
&height | height | |
&z | depth, usually not used |
void ParaScripting::ParaUIObject::SetPosition | ( | const char * | pos | ) |
set rect position of the control.
pos,: | in format "x y width height" |
void ParaScripting::ParaUIObject::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 ParaUI::CreateUIObject() for parameter definition.
void ParaScripting::ParaUIObject::OnClick | ( | const char * | strScriptName | ) |
When the user clicked on the window, the script file or function will be activated.
The following parameters are passed as global variables. id = int; -- the id of the triggering GUI window mouse_button = ["left"|"right"|"middle"]; mouse_x = number; mouse_y = number;
strScriptName,: | the NPL script file to activate. |
void ParaScripting::ParaUIObject::OnSize | ( | const char * | strScriptName | ) |
called when the size of the window is changed.
id = int; -- the id of the triggering GUI window
void ParaScripting::ParaUIObject::OnActivate | ( | const char * | strScriptName | ) |
called when the size of the window is changed.
id = int; -- the id of the triggering GUI window param1: Specifies whether the window is being activated or deactivated. It can be one of the following values:
void ParaScripting::ParaUIObject::OnDoubleClick | ( | const char * | strScriptName | ) |
The following parameters are passed as global variables.
id = int; -- the id of the triggering GUI window mouse_button = ["left"|"right"|"middle"]; mouse_x = number; mouse_y = number;
strScriptName |
void ParaScripting::ParaUIObject::OnKeyDown | ( | const char * | strScriptName | ) |
When the user pressed a key while the mouse cursor is inside the window, a script file or function will be activated.
The following parameters are passed as global variables. id = int; -- the id of the triggering GUI window keystring = string;--it is filled with the key character. e.g. "\r", "a", etc. It may contain multiple characters, if the user is typing fast or Multi-byte such as Chinese Character is entered.
strScriptName,: | the NPL script file to activate. |
void ParaScripting::ParaUIObject::SetCursor | ( | const char * | szCursorFile | ) |
Set/Get cusor file when mouse is over it.
If empty, the parent cursor file is used.
void ParaScripting::ParaUIObject::OnChange | ( | const char * | strScriptName | ) |
usually the editbox will call this handle, "virtual_key" contains the last key stroke.
Usually application may check if it is an enter key for special actions.
void ParaScripting::ParaUIObject::SetRotation | ( | float | fRot | ) |
set the rotation of the control around the center of the UI plus rotation origin offset.
it only affects the drawing rect but not the mouse sensor rect. it is usually used for visual effect, so there is no need to update or calculate client rect.
float ParaScripting::ParaUIObject::GetRotation | ( | ) | const |
Get the rotation of the control around the center of the UI plus rotation origin offset.
it only affects the drawing rect but not the mouse sensor rect. it is usually used for visual effect, so there is no need to update or calculate client rect.
void ParaScripting::ParaUIObject::SetRotOriginOffset | ( | float | x, | |
float | y | |||
) |
rotation origin offset from the center of the UI object.
void ParaScripting::ParaUIObject::GetRotOriginOffset | ( | float * | x, | |
float * | y | |||
) | const |
rotation origin offset from the center of the UI object.
void ParaScripting::ParaUIObject::SetScaling | ( | float | x, | |
float | y | |||
) |
set the scaling of the control around the center of the UI plus rotation origin offset.
it only affects the drawing rect but not the mouse sensor rect. it is usually used for visual effect, so there is no need to update or calculate client rect.
void ParaScripting::ParaUIObject::GetScaling | ( | float * | x, | |
float * | y | |||
) | const |
Get the scaling of the control around the center of the UI plus rotation origin offset.
it only affects the drawing rect but not the mouse sensor rect. it is usually used for visual effect, so there is no need to update or calculate client rect.
void ParaScripting::ParaUIObject::SetTranslation | ( | float | x, | |
float | y | |||
) |
set the translation of the control around the center of the UI plus rotation origin offset.
it only affects the drawing rect but not the mouse sensor rect. it is usually used for visual effect, so there is no need to update or calculate client rect.
void ParaScripting::ParaUIObject::GetTranslation | ( | float * | x, | |
float * | y | |||
) | const |
Get the translation of the control around the center of the UI plus rotation origin offset.
it only affects the drawing rect but not the mouse sensor rect. it is usually used for visual effect, so there is no need to update or calculate client rect.
void ParaScripting::ParaUIObject::AttachTo3D | ( | const ParaObject | obj | ) |
Attach the control to the 3D object.
This function will internally call AttachToRoot() if it has not been called previously One can call this function multiple times move the attached GUI object from one 3D object to another.
obj,: | this must be a global object |
void ParaScripting::ParaUIObject::AttachTo3D_ | ( | const char * | s3DObjectName | ) |
save as AttachTo3D, except that the 3D object's name is specified.
s3DObjectName,: | this must be the name of a global object. |
void ParaScripting::ParaUIObject::DoAutoSize | ( | ) |
try to automatically adjust the size of this object to contain all its content.
ParaUITexture ParaScripting::ParaUIObject::GetTexture | ( | const char * | name | ) |
Get the texture object associated with the current control A control may be associated with multiple textures.
name,: | different controls have set of textures. it can be one of the following predefined string.
|
int ParaScripting::ParaUIObject::GetZOrder | ( | ) | const |
z order affect the order of rendering.
The parent control sort and render child control from small z value to larger z value. default value is 0.
void ParaScripting::ParaUIObject::SetZOrder | ( | int | nOrder | ) |
z order affect the order of rendering.
The parent control sort and render child control from small z value to larger z value. default value is 0. if this control has a parent it will cause the parent to sort all children again.
void ParaScripting::ParaUIObject::SetActiveLayer | ( | const char * | layer | ) |
Set the active layer for setting resource;.
layer,: | name of the layer We have three layers "artwork", "background" and "overlay" "artwork" layer is the primary layer. By default, we render a control using this layer "overlay" layer is a layer on top of the "artwork" layer. "background" layer is on the bottom of the "artwork" layer. All three layers are the same. If not implicitly set, the default active layer is the "artwork" layer. But when a user wants to set something, remember to call this function to ensure that the active layer is correct. |
bool ParaScripting::ParaUIObject::HasLayer | ( | const char * | layer | ) |
return whether a given layer exist in the resource.
One needs to call SetActiveLayer() in order to create a layer.
layer,: | it can be one of the three layers "artwork", "background" and "overlay". Typically, all controls contains the "artwork" layer. |
void ParaScripting::ParaUIObject::SetCurrentState | ( | const char * | statename | ) |
Set the current state for setting resource:.
statename,: | name of the state We have four states "normal", "highlight", "pressed", "disabled" "normal" state is the default state. "highlight" state is the highlighted state. Some controls will change their state to "highlight" automatically when mouse enters them. "pressed" state is when a button or something else is pressed. "disabled" state is when a control is disabled. If not implicitly set, the default state is the "normal" state. But when a user wants to set something, remember to call this function to ensure that the current state is correct. |
void ParaScripting::ParaUIObject::CloneState | ( | const char * | statename | ) |
Clones a state to the current state.
statename,: | name of the state We have four states "normal", "highlight", "pressed", "disabled" "normal" state is the default state. "highlight" state is the highlighted state. Some controls will change their state to "highlight" automatically when mouse enters them. "pressed" state is when a button or something else is pressed. "disabled" state is when a control is disabled. |