|
| Text (Context *context) |
| Construct.
|
|
| ~Text () override |
| Destruct.
|
|
void | ApplyAttributes () override |
| Apply attribute changes that can not be applied immediately. More...
|
|
void | GetBatches (Vector< UIBatch > &batches, Vector< float > &vertexData, const IntRect ¤tScissor) override |
| Return UI rendering batches. More...
|
|
void | OnResize (const IntVector2 &newSize, const IntVector2 &delta) override |
| React to resize. More...
|
|
void | OnIndentSet () override |
| React to indent change. More...
|
|
bool | SetFont (const String &fontName, float size=DEFAULT_FONT_SIZE) |
| Set font by looking from resource cache by name and font size. Return true if successful.
|
|
bool | SetFont (Font *font, float size=DEFAULT_FONT_SIZE) |
| Set font and font size. Return true if successful.
|
|
bool | SetFontSize (float size) |
| Set font size only while retaining the existing font. Return true if successful.
|
|
void | SetText (const String &text) |
| Set text. Text is assumed to be either ASCII or UTF8-encoded.
|
|
void | SetTextAlignment (HorizontalAlignment align) |
| Set row alignment.
|
|
void | SetRowSpacing (float spacing) |
| Set row spacing, 1.0 for original font spacing.
|
|
void | SetWordwrap (bool enable) |
| Set wordwrap. In wordwrap mode the text element will respect its current width. Otherwise it resizes itself freely.
|
|
void | SetAutoLocalizable (bool enable) |
| The text will be automatically translated. The text value used as string identifier.
|
|
void | SetSelection (i32 start, i32 length=M_MAX_INT) |
| Set selection. When length is not provided, select until the text ends.
|
|
void | ClearSelection () |
| Clear selection.
|
|
void | SetTextEffect (TextEffect textEffect) |
| Set text effect.
|
|
void | SetEffectShadowOffset (const IntVector2 &offset) |
| Set shadow offset.
|
|
void | SetEffectStrokeThickness (int thickness) |
| Set stroke thickness.
|
|
void | SetEffectRoundStroke (bool roundStroke) |
| Set stroke rounding. Corners of the font will be rounded off in the stroke so the stroke won't have corners.
|
|
void | SetEffectColor (const Color &effectColor) |
| Set effect color.
|
|
Font * | GetFont () const |
| Return font.
|
|
float | GetFontSize () const |
| Return font size.
|
|
const String & | GetText () const |
| Return text.
|
|
HorizontalAlignment | GetTextAlignment () const |
| Return row alignment.
|
|
float | GetRowSpacing () const |
| Return row spacing.
|
|
bool | GetWordwrap () const |
| Return wordwrap mode.
|
|
bool | GetAutoLocalizable () const |
| Return auto localizable mode.
|
|
i32 | GetSelectionStart () const |
| Return selection start.
|
|
i32 | GetSelectionLength () const |
| Return selection length.
|
|
TextEffect | GetTextEffect () const |
| Return text effect.
|
|
const IntVector2 & | GetEffectShadowOffset () const |
| Return effect shadow offset.
|
|
int | GetEffectStrokeThickness () const |
| Return effect stroke thickness.
|
|
bool | GetEffectRoundStroke () const |
| Return effect round stroke.
|
|
const Color & | GetEffectColor () const |
| Return effect color.
|
|
float | GetRowHeight () const |
| Return row height.
|
|
i32 | GetNumRows () const |
| Return number of rows.
|
|
i32 | GetNumChars () const |
| Return number of characters.
|
|
float | GetRowWidth (i32 index) const |
| Return width of row by index.
|
|
Vector2 | GetCharPosition (i32 index) |
| Return position of character by index relative to the text element origin.
|
|
Vector2 | GetCharSize (i32 index) |
| Return size of character by index.
|
|
void | SetEffectDepthBias (float bias) |
| Set text effect Z bias. Zero by default, adjusted only in 3D mode.
|
|
float | GetEffectDepthBias () const |
| Return effect Z bias.
|
|
void | SetFontAttr (const ResourceRef &value) |
| Set font attribute.
|
|
ResourceRef | GetFontAttr () const |
| Return font attribute.
|
|
void | SetTextAttr (const String &value) |
| Set text attribute.
|
|
String | GetTextAttr () const |
| Return text attribute.
|
|
| URHO3D_OBJECT (UISelectable, UIElement) |
|
| ~UISelectable () override=default |
| Destruct.
|
|
void | GetBatches (Vector< UIBatch > &batches, Vector< float > &vertexData, const IntRect ¤tScissor) override |
| Return UI rendering batches. More...
|
|
void | SetSelectionColor (const Color &color) |
| Set selection background color. Color with 0 alpha (default) disables.
|
|
void | SetHoverColor (const Color &color) |
| Set hover background color. Color with 0 alpha (default) disables.
|
|
const Color & | GetSelectionColor () const |
| Return selection background color.
|
|
const Color & | GetHoverColor () const |
| Return hover background color.
|
|
| UIElement (Context *context) |
| Construct.
|
|
| UIElement (Context *context) |
| Construct.
|
|
| ~UIElement () override |
| Destruct.
|
|
void | ApplyAttributes () override |
| Apply attribute changes that can not be applied immediately. More...
|
|
bool | LoadXML (const XMLElement &source) override |
| Load from XML data. Return true if successful. More...
|
|
virtual bool | LoadXML (const XMLElement &source, XMLFile *styleFile) |
| Load from XML data with style. Return true if successful. More...
|
|
virtual UIElement * | LoadChildXML (const XMLElement &childElem, XMLFile *styleFile) |
| Create a child by loading from XML data with style. Returns the child element if successful, null if otherwise.
|
|
bool | SaveXML (XMLElement &dest) const override |
| Save as XML data. Return true if successful. More...
|
|
virtual void | Update (float timeStep) |
| Perform UI element update. More...
|
|
virtual bool | IsWithinScissor (const IntRect ¤tScissor) |
| Return whether is visible and inside a scissor rectangle and should be rendered. More...
|
|
virtual const IntVector2 & | GetScreenPosition () const |
| Update and return screen position. More...
|
|
virtual void | GetBatches (Vector< UIBatch > &batches, Vector< float > &vertexData, const IntRect ¤tScissor) |
| Return UI rendering batches. More...
|
|
virtual void | GetDebugDrawBatches (Vector< UIBatch > &batches, Vector< float > &vertexData, const IntRect ¤tScissor) |
| Return UI rendering batches for debug draw.
|
|
virtual void | OnHover (const IntVector2 &position, const IntVector2 &screenPosition, MouseButtonFlags buttons, QualifierFlags qualifiers, Cursor *cursor) |
| React to mouse hover. More...
|
|
virtual void | OnClickBegin (const IntVector2 &position, const IntVector2 &screenPosition, MouseButton button, MouseButtonFlags buttons, QualifierFlags qualifiers, Cursor *cursor) |
| React to mouse click begin. More...
|
|
virtual void | OnClickEnd (const IntVector2 &position, const IntVector2 &screenPosition, MouseButton button, MouseButtonFlags buttons, QualifierFlags qualifiers, Cursor *cursor, UIElement *beginElement) |
| React to mouse click end. More...
|
|
virtual void | OnDoubleClick (const IntVector2 &position, const IntVector2 &screenPosition, MouseButton button, MouseButtonFlags buttons, QualifierFlags qualifiers, Cursor *cursor) |
| React to double mouse click. More...
|
|
virtual void | OnDragBegin (const IntVector2 &position, const IntVector2 &screenPosition, MouseButtonFlags buttons, QualifierFlags qualifiers, Cursor *cursor) |
| React to mouse drag begin. More...
|
|
virtual void | OnDragMove (const IntVector2 &position, const IntVector2 &screenPosition, const IntVector2 &deltaPos, MouseButtonFlags buttons, QualifierFlags qualifiers, Cursor *cursor) |
| React to mouse drag motion. More...
|
|
virtual void | OnDragEnd (const IntVector2 &position, const IntVector2 &screenPosition, MouseButtonFlags dragButtons, MouseButtonFlags releaseButtons, Cursor *cursor) |
| React to mouse drag end. More...
|
|
virtual void | OnDragCancel (const IntVector2 &position, const IntVector2 &screenPosition, MouseButtonFlags dragButtons, MouseButtonFlags cancelButtons, Cursor *cursor) |
| React to a mouse drag cancel event (ie, when an extra button is pressed). More...
|
|
virtual bool | OnDragDropTest (UIElement *source) |
| React to drag and drop test. Return true to signal that the drop is acceptable. More...
|
|
virtual bool | OnDragDropFinish (UIElement *source) |
| React to drag and drop finish. Return true to signal that the drop was accepted. More...
|
|
virtual void | OnWheel (int delta, MouseButtonFlags buttons, QualifierFlags qualifiers) |
| React to mouse wheel. More...
|
|
virtual void | OnKey (Key key, MouseButtonFlags buttons, QualifierFlags qualifiers) |
| React to a key press. More...
|
|
virtual void | OnTextInput (const String &text) |
| React to text input event. More...
|
|
virtual void | OnResize (const IntVector2 &newSize, const IntVector2 &delta) |
| React to resize. More...
|
|
virtual void | OnPositionSet (const IntVector2 &newPosition) |
| React to position change. More...
|
|
virtual void | OnSetEditable () |
| React to editable status change. More...
|
|
virtual void | OnIndentSet () |
| React to indent change. More...
|
|
virtual IntVector2 | ScreenToElement (const IntVector2 &screenPosition) |
| Convert screen coordinates to element coordinates. More...
|
|
virtual IntVector2 | ElementToScreen (const IntVector2 &position) |
| Convert element coordinates to screen coordinates. More...
|
|
virtual bool | IsWheelHandler () const |
| Return whether the element could handle wheel input. More...
|
|
bool | LoadXML (Deserializer &source) |
| Load from an XML file. Return true if successful.
|
|
bool | SaveXML (Serializer &dest, const String &indentation="\t") const |
| Save to an XML file. Return true if successful.
|
|
bool | FilterAttributes (XMLElement &dest) const |
| Filter attributes in serialization process.
|
|
void | SetName (const String &name) |
| Set name.
|
|
void | SetPosition (const IntVector2 &position) |
| Set position.
|
|
void | SetPosition (int x, int y) |
| Set position.
|
|
void | SetSize (const IntVector2 &size) |
| Set size.
|
|
void | SetSize (int width, int height) |
| Set size.
|
|
void | SetWidth (int width) |
| Set width only.
|
|
void | SetHeight (int height) |
| Set height only.
|
|
void | SetMinSize (const IntVector2 &minSize) |
| Set minimum size.
|
|
void | SetMinSize (int width, int height) |
| Set minimum size.
|
|
void | SetMinWidth (int width) |
| Set minimum width.
|
|
void | SetMinHeight (int height) |
| Set minimum height.
|
|
void | SetMaxSize (const IntVector2 &maxSize) |
| Set maximum size.
|
|
void | SetMaxSize (int width, int height) |
| Set maximum size.
|
|
void | SetMaxWidth (int width) |
| Set maximum width.
|
|
void | SetMaxHeight (int height) |
| Set maximum height.
|
|
void | SetFixedSize (const IntVector2 &size) |
| Set fixed size.
|
|
void | SetFixedSize (int width, int height) |
| Set fixed size.
|
|
void | SetFixedWidth (int width) |
| Set fixed width.
|
|
void | SetFixedHeight (int height) |
| Set fixed height.
|
|
void | SetAlignment (HorizontalAlignment hAlign, VerticalAlignment vAlign) |
| Set horizontal and vertical alignment.
|
|
void | SetHorizontalAlignment (HorizontalAlignment align) |
| Set horizontal alignment.
|
|
void | SetVerticalAlignment (VerticalAlignment align) |
| Set vertical alignment.
|
|
void | SetEnableAnchor (bool enable) |
| Enable automatic positioning & sizing of the element relative to its parent using min/max anchor and min/max offset. Default false.
|
|
void | SetMinAnchor (const Vector2 &anchor) |
| Set minimum (top left) anchor in relation to the parent element (from 0 to 1). No effect when anchor is not enabled.
|
|
void | SetMinAnchor (float x, float y) |
| Set minimum anchor.
|
|
void | SetMaxAnchor (const Vector2 &anchor) |
| Set maximum (bottom right) anchor in relation to the parent element (from 0 to 1). No effect when anchor is not enabled.
|
|
void | SetMaxAnchor (float x, float y) |
| Set maximum anchor.
|
|
void | SetMinOffset (const IntVector2 &offset) |
| Set offset of element's top left from the minimum anchor in pixels. No effect when anchor is not enabled.
|
|
void | SetMaxOffset (const IntVector2 &offset) |
| Set offset of element's bottom right from the maximum anchor in pixels. No effect when anchor is not enabled.
|
|
void | SetPivot (const Vector2 &pivot) |
| Set pivot relative to element's size (from 0 to 1, where 0.5 is center). Overrides horizontal & vertical alignment.
|
|
void | SetPivot (float x, float y) |
| Set pivot relative to element's size (from 0 to 1, where 0.5 is center). Overrides horizontal & vertical alignment.
|
|
void | SetClipBorder (const IntRect &rect) |
| Set child element clipping border.
|
|
void | SetColor (const Color &color) |
| Set color on all corners.
|
|
void | SetColor (Corner corner, const Color &color) |
| Set color on one corner.
|
|
void | SetPriority (int priority) |
| Set priority.
|
|
void | SetOpacity (float opacity) |
| Set opacity.
|
|
void | SetBringToFront (bool enable) |
| Set whether should be brought to front when focused.
|
|
void | SetBringToBack (bool enable) |
| Set whether should be put to background when another element is focused.
|
|
void | SetClipChildren (bool enable) |
| Set whether should clip child elements. Default false.
|
|
void | SetSortChildren (bool enable) |
| Set whether should sort child elements according to priority. Default true.
|
|
void | SetUseDerivedOpacity (bool enable) |
| Set whether parent elements' opacity affects opacity. Default true.
|
|
void | SetEnabled (bool enable) |
| Set whether reacts to input. Default false, but is enabled by subclasses if applicable.
|
|
void | SetDeepEnabled (bool enable) |
| Set enabled state on self and child elements. Elements' own enabled state is remembered (IsEnabledSelf) and can be restored.
|
|
void | ResetDeepEnabled () |
| Reset enabled state to the element's remembered state prior to calling SetDeepEnabled.
|
|
void | SetEnabledRecursive (bool enable) |
| Set enabled state on self and child elements. Unlike SetDeepEnabled this does not remember the elements' own enabled state, but overwrites it.
|
|
void | SetEditable (bool enable) |
| Set whether value is editable through input. Not applicable to all elements. Default true.
|
|
void | SetFocus (bool enable) |
| Set whether is focused. Only one element can be focused at a time.
|
|
void | SetSelected (bool enable) |
| Set selected mode. Actual meaning is element dependent, for example constant hover or pressed effect.
|
|
void | SetVisible (bool enable) |
| Set whether is visible. Visibility propagates to child elements.
|
|
void | SetFocusMode (FocusMode mode) |
| Set focus mode.
|
|
void | SetDragDropMode (DragAndDropModeFlags mode) |
| Set drag and drop flags.
|
|
bool | SetStyle (const String &styleName, XMLFile *file=nullptr) |
| Set style from an XML file. Find the style element by name. If the style file is not explicitly provided, use the default style from parental chain. Return true if the style is applied successfully. See also Defining UI layouts programmatically.
|
|
bool | SetStyle (const XMLElement &element) |
| Set style from an XML element. Return true if the style is applied successfully.
|
|
bool | SetStyleAuto (XMLFile *file=nullptr) |
| Set style from an XML file. Find the style element automatically by using the element's typename. If the style file is not explicitly provided, use the default style from parental chain. Return true if the style is applied successfully. See also Defining UI layouts programmatically.
|
|
void | SetDefaultStyle (XMLFile *style) |
| Set default style file for later use by children elements.
|
|
void | SetLayout (LayoutMode mode, int spacing=0, const IntRect &border=IntRect::ZERO) |
| Set layout parameters.
|
|
void | SetLayoutMode (LayoutMode mode) |
| Set layout mode only.
|
|
void | SetLayoutSpacing (int spacing) |
| Set layout spacing.
|
|
void | SetLayoutBorder (const IntRect &border) |
| Set layout border.
|
|
void | SetLayoutFlexScale (const Vector2 &scale) |
| Set layout flex scale.
|
|
void | SetIndent (int indent) |
| Set horizontal indentation.
|
|
void | SetIndentSpacing (int indentSpacing) |
| Set indent spacing (number of pixels per indentation level).
|
|
void | UpdateLayout () |
| Manually update layout. Should not be necessary in most cases, but is provided for completeness.
|
|
void | DisableLayoutUpdate () |
| Disable automatic layout update. Should only be used if there are performance problems.
|
|
void | EnableLayoutUpdate () |
| Enable automatic layout update.
|
|
void | BringToFront () |
| Bring UI element to front.
|
|
UIElement * | CreateChild (StringHash type, const String &name=String::EMPTY, i32 index=ENDPOS) |
| Create and add a child element and return it.
|
|
void | AddChild (UIElement *element) |
| Add a child element.
|
|
void | InsertChild (i32 index, UIElement *element) |
| Insert a child element into a specific position in the child list. index can be ENDPOS.
|
|
void | RemoveChild (UIElement *element, i32 index=0) |
| Remove a child element. Starting search at specified index if provided.
|
|
void | RemoveChildAtIndex (i32 index) |
| Remove a child element at index.
|
|
void | RemoveAllChildren () |
| Remove all child elements.
|
|
void | Remove () |
| Remove from the parent element. If no other shared pointer references exist, causes immediate deletion.
|
|
i32 | FindChild (UIElement *element) const |
| Find child index. Return NINDEX if not found.
|
|
void | SetParent (UIElement *parent, i32 index=ENDPOS) |
| Set parent element. Same as parent->InsertChild(index, this).
|
|
void | SetVar (StringHash key, const Variant &value) |
| Set a user variable.
|
|
void | SetInternal (bool enable) |
| Mark as internally (programmatically) created. Used when an element composes itself out of child elements.
|
|
void | SetTraversalMode (TraversalMode traversalMode) |
| Set traversal mode for rendering. The default traversal mode is TM_BREADTH_FIRST for non-root element. Root element should be set to TM_DEPTH_FIRST to avoid artifacts during rendering.
|
|
void | SetElementEventSender (bool flag) |
| Set element event sender flag. When child element is added or deleted, the event would be sent using UIElement found in the parental chain having this flag set. If not set, the event is sent using UI's root as per normal.
|
|
void | SetTags (const StringVector &tags) |
| Set tags. Old tags are overwritten.
|
|
void | AddTag (const String &tag) |
| Add a tag.
|
|
void | AddTags (const String &tags, char separator=';') |
| Add tags with the specified separator (; by default).
|
|
void | AddTags (const StringVector &tags) |
| Add tags.
|
|
bool | RemoveTag (const String &tag) |
| Remove specific tag. Return true if existed.
|
|
void | RemoveAllTags () |
| Remove all tags.
|
|
template<class T > |
T * | CreateChild (const String &name=String::EMPTY, i32 index=ENDPOS) |
| Template version of creating a child element.
|
|
template<class T > |
T * | GetChildStaticCast (i32 index) const |
| Template version of returning child element by index using static cast.
|
|
template<class T > |
T * | GetChildStaticCast (const String &name, bool recursive=false) const |
| Template version of returning child element by name using static cast.
|
|
template<class T > |
T * | GetChildStaticCast (const StringHash &key, const Variant &value=Variant::EMPTY, bool recursive=false) const |
| Template version of returning child element by variable using static cast. If only key is provided, return the first child having the matching variable key. If value is also provided then the actual variable value would also be checked against.
|
|
template<class T > |
T * | GetChildDynamicCast (i32 index) const |
| Template version of returning child element by index using dynamic cast. May return 0 when casting failed.
|
|
template<class T > |
T * | GetChildDynamicCast (const String &name, bool recursive=false) const |
| Template version of returning child element by name using dynamic cast. May return 0 when casting failed.
|
|
template<class T > |
T * | GetChildDynamicCast (const StringHash &key, const Variant &value=Variant::EMPTY, bool recursive=false) const |
| Template version of returning child element by variable. If only key is provided, return the first child having the matching variable key. If value is also provided then the actual variable value would also be checked against using dynamic cast. May return 0 when casting failed.
|
|
const String & | GetName () const |
| Return name.
|
|
const IntVector2 & | GetPosition () const |
| Return position.
|
|
const IntVector2 & | GetSize () const |
| Return size.
|
|
int | GetWidth () const |
| Return width.
|
|
int | GetHeight () const |
| Return height.
|
|
const IntVector2 & | GetMinSize () const |
| Return minimum size.
|
|
int | GetMinWidth () const |
| Return minimum width.
|
|
int | GetMinHeight () const |
| Return minimum height.
|
|
const IntVector2 & | GetMaxSize () const |
| Return maximum size.
|
|
int | GetMaxWidth () const |
| Return minimum width.
|
|
int | GetMaxHeight () const |
| Return minimum height.
|
|
bool | IsFixedSize () const |
| Return true if size is fixed.
|
|
bool | IsFixedWidth () const |
| Return true if width is fixed.
|
|
bool | IsFixedHeight () const |
| Return true if height is fixed.
|
|
const IntVector2 & | GetChildOffset () const |
| Return child element offset.
|
|
HorizontalAlignment | GetHorizontalAlignment () const |
| Return horizontal alignment. If pivot has been adjusted to a custom horizontal setting, returns HA_CUSTOM.
|
|
VerticalAlignment | GetVerticalAlignment () const |
| Return vertical alignment. If pivot has been adjusted to a custom vertical setting, returns VA_CUSTOM.
|
|
bool | GetEnableAnchor () const |
| Return whether anchor positioning & sizing is enabled.
|
|
const Vector2 & | GetMinAnchor () const |
| Return minimum anchor.
|
|
const Vector2 & | GetMaxAnchor () const |
| Return maximum anchor.
|
|
const IntVector2 & | GetMinOffset () const |
|
const IntVector2 & | GetMaxOffset () const |
|
const Vector2 & | GetPivot () const |
| Return pivot.
|
|
const IntRect & | GetClipBorder () const |
| Return child element clipping border.
|
|
const Color & | GetColor (Corner corner) const |
| Return corner color.
|
|
int | GetPriority () const |
| Return priority.
|
|
float | GetOpacity () const |
| Return opacity.
|
|
float | GetDerivedOpacity () const |
| Return derived opacity (affected by parent elements). If UseDerivedOpacity is false, returns same as element's own opacity.
|
|
bool | GetBringToFront () const |
| Return whether should be brought to front when focused.
|
|
bool | GetBringToBack () const |
| Return whether should be put to background when another element is focused.
|
|
bool | GetClipChildren () const |
| Return whether should clip child elements.
|
|
bool | GetSortChildren () const |
| Return whether should sort child elements according to priority.
|
|
bool | GetUseDerivedOpacity () const |
| Return whether parent elements' opacity affects opacity.
|
|
bool | HasFocus () const |
| Return whether has focus.
|
|
bool | IsChildOf (UIElement *element) const |
| Return whether is a direct or indirect child of specified element.
|
|
bool | IsEnabled () const |
| Return whether reacts to input.
|
|
bool | IsEnabledSelf () const |
| Returns the element's last own enabled state. May be different than the value returned by IsEnabled when SetDeepEnabled has been used.
|
|
bool | IsEditable () const |
| Return whether value is editable through input.
|
|
bool | IsSelected () const |
| Return whether is selected. Actual meaning is element dependent.
|
|
bool | IsVisible () const |
| Return whether element itself should be visible. Elements can be also hidden due to the parent being not visible, use IsVisibleEffective() to check.
|
|
bool | IsVisibleEffective () const |
| Return whether element is effectively visible (parent element chain is visible).
|
|
bool | IsHovering () const |
| Return whether the cursor is hovering on this element.
|
|
bool | IsInternal () const |
| Return whether is internally created.
|
|
bool | HasColorGradient () const |
| Return whether has different color in at least one corner.
|
|
FocusMode | GetFocusMode () const |
| Return focus mode.
|
|
DragAndDropModeFlags | GetDragDropMode () const |
| Return drag and drop flags.
|
|
const String & | GetAppliedStyle () const |
| Return applied style name. Return an empty string when the applied style is an 'auto' style (i.e. style derived from instance's type).
|
|
XMLFile * | GetDefaultStyle (bool recursiveUp=true) const |
| Return default style.
|
|
LayoutMode | GetLayoutMode () const |
| Return layout mode.
|
|
int | GetLayoutSpacing () const |
| Return layout spacing.
|
|
const IntRect & | GetLayoutBorder () const |
| Return layout border.
|
|
const Vector2 & | GetLayoutFlexScale () const |
| Return layout flex scale.
|
|
i32 | GetNumChildren (bool recursive=false) const |
| Return number of child elements.
|
|
UIElement * | GetChild (i32 index) const |
| Return child element by index.
|
|
UIElement * | GetChild (const String &name, bool recursive=false) const |
| Return child element by name.
|
|
UIElement * | GetChild (const StringHash &key, const Variant &value=Variant::EMPTY, bool recursive=false) const |
| Return child element by variable. If only key is provided, return the first child having the matching variable key. If value is also provided then the actual variable value would also be checked against.
|
|
const Vector< SharedPtr< UIElement > > & | GetChildren () const |
| Return immediate child elements.
|
|
void | GetChildren (Vector< UIElement * > &dest, bool recursive=false) const |
| Return child elements either recursively or non-recursively.
|
|
Vector< UIElement * > | GetChildren (bool recursive) const |
| Return child elements, optionally recursive.
|
|
UIElement * | GetParent () const |
| Return parent element.
|
|
UIElement * | GetRoot () const |
| Return root element.
|
|
const Color & | GetDerivedColor () const |
| Return derived color. Only valid when no gradient.
|
|
const Variant & | GetVar (const StringHash &key) const |
| Return a user variable.
|
|
const VariantMap & | GetVars () const |
| Return all user variables.
|
|
bool | HasTag (const String &tag) const |
| Return whether element is tagged by a specific tag.
|
|
const StringVector & | GetTags () const |
| Return all tags.
|
|
void | GetChildrenWithTag (Vector< UIElement * > &dest, const String &tag, bool recursive=false) const |
| Return child elements with a specific tag either recursively or non-recursively.
|
|
Vector< UIElement * > | GetChildrenWithTag (const String &tag, bool recursive=false) const |
| Return child elements with a specific tag either recursively or non-recursively.
|
|
MouseButtonFlags | GetDragButtonCombo () const |
| Return the drag button combo if this element is being dragged.
|
|
i32 | GetDragButtonCount () const |
| Return the number of buttons dragging this element.
|
|
bool | IsInside (IntVector2 position, bool isScreen) |
| Return whether a point (either in element or screen coordinates) is inside the element.
|
|
bool | IsInsideCombined (IntVector2 position, bool isScreen) |
| Return whether a point (either in element or screen coordinates) is inside the combined rect of the element and its children.
|
|
IntRect | GetCombinedScreenRect () |
| Return combined screen coordinate rect of element and its children.
|
|
void | SortChildren () |
| Sort child elements if sorting enabled and order dirty. Called by UI.
|
|
int | GetLayoutElementMaxSize () const |
| Return maximum layout element size in the layout direction. Only valid after layout has been calculated. Used internally by UI for optimizations.
|
|
int | GetIndent () const |
| Return horizontal indentation.
|
|
int | GetIndentSpacing () const |
| Return indent spacing (number of pixels per indentation level).
|
|
int | GetIndentWidth () const |
| Return indent width in pixels.
|
|
void | SetChildOffset (const IntVector2 &offset) |
| Set child offset.
|
|
void | SetHovering (bool enable) |
| Set hovering state.
|
|
void | AdjustScissor (IntRect ¤tScissor) |
| Adjust scissor for rendering.
|
|
void | GetBatchesWithOffset (IntVector2 &offset, Vector< UIBatch > &batches, Vector< float > &vertexData, IntRect currentScissor) |
| Get UI rendering batches with a specified offset. Also recurse to child elements.
|
|
const Color & | GetColorAttr () const |
| Return color attribute. Uses just the top-left color.
|
|
TraversalMode | GetTraversalMode () const |
| Return traversal mode for rendering.
|
|
bool | IsElementEventSender () const |
| Return whether element should send child added / removed events by itself. If false, defers to parent element.
|
|
UIElement * | GetElementEventSender () const |
| Get element which should send child added / removed events.
|
|
IntVector2 | GetEffectiveMinSize () const |
| Return effective minimum size, also considering layout. Used internally.
|
|
void | SetRenderTexture (Texture2D *texture) |
| Set texture to which element will be rendered.
|
|
| Animatable (Context *context) |
| Construct.
|
|
| ~Animatable () override |
| Destruct.
|
|
bool | LoadXML (const XMLElement &source) override |
| Load from XML data. Return true if successful. More...
|
|
bool | SaveXML (XMLElement &dest) const override |
| Save as XML data. Return true if successful. More...
|
|
bool | LoadJSON (const JSONValue &source) override |
| Load from JSON data. Return true if successful. More...
|
|
bool | SaveJSON (JSONValue &dest) const override |
| Save as JSON data. Return true if successful. More...
|
|
void | SetAnimationEnabled (bool enable) |
| Set automatic update of animation, default true.
|
|
void | SetAnimationTime (float time) |
| Set time position of all attribute animations or an object animation manually. Automatic update should be disabled in this case.
|
|
void | SetObjectAnimation (ObjectAnimation *objectAnimation) |
| Set object animation.
|
|
void | SetAttributeAnimation (const String &name, ValueAnimation *attributeAnimation, WrapMode wrapMode=WM_LOOP, float speed=1.0f) |
| Set attribute animation.
|
|
void | SetAttributeAnimationWrapMode (const String &name, WrapMode wrapMode) |
| Set attribute animation wrap mode.
|
|
void | SetAttributeAnimationSpeed (const String &name, float speed) |
| Set attribute animation speed.
|
|
void | SetAttributeAnimationTime (const String &name, float time) |
| Set attribute animation time position manually. Automatic update should be disabled in this case.
|
|
void | RemoveObjectAnimation () |
| Remove object animation. Same as calling SetObjectAnimation with a null pointer.
|
|
void | RemoveAttributeAnimation (const String &name) |
| Remove attribute animation. Same as calling SetAttributeAnimation with a null pointer.
|
|
bool | GetAnimationEnabled () const |
| Return animation enabled.
|
|
ObjectAnimation * | GetObjectAnimation () const |
| Return object animation.
|
|
ValueAnimation * | GetAttributeAnimation (const String &name) const |
| Return attribute animation.
|
|
WrapMode | GetAttributeAnimationWrapMode (const String &name) const |
| Return attribute animation wrap mode.
|
|
float | GetAttributeAnimationSpeed (const String &name) const |
| Return attribute animation speed.
|
|
float | GetAttributeAnimationTime (const String &name) const |
| Return attribute animation time position.
|
|
void | SetObjectAnimationAttr (const ResourceRef &value) |
| Set object animation attribute.
|
|
ResourceRef | GetObjectAnimationAttr () const |
| Return object animation attribute.
|
|
| Serializable (Context *context) |
| Construct.
|
|
| ~Serializable () override |
| Destruct.
|
|
virtual void | OnSetAttribute (const AttributeInfo &attr, const Variant &src) |
| Handle attribute write access. Default implementation writes to the variable at offset, or invokes the set accessor.
|
|
virtual void | OnGetAttribute (const AttributeInfo &attr, Variant &dest) const |
| Handle attribute read access. Default implementation reads the variable at offset, or invokes the get accessor.
|
|
virtual const Vector< AttributeInfo > * | GetAttributes () const |
| Return attribute descriptions, or null if none defined. More...
|
|
virtual const Vector< AttributeInfo > * | GetNetworkAttributes () const |
| Return network replication attribute descriptions, or null if none defined.
|
|
virtual bool | Load (Deserializer &source) |
| Load from binary data. Return true if successful. More...
|
|
virtual bool | Save (Serializer &dest) const |
| Save as binary data. Return true if successful. More...
|
|
virtual bool | LoadXML (const XMLElement &source) |
| Load from XML data. Return true if successful. More...
|
|
virtual bool | SaveXML (XMLElement &dest) const |
| Save as XML data. Return true if successful. More...
|
|
virtual bool | LoadJSON (const JSONValue &source) |
| Load from JSON data. Return true if successful. More...
|
|
virtual bool | SaveJSON (JSONValue &dest) const |
| Save as JSON data. Return true if successful. More...
|
|
virtual void | ApplyAttributes () |
| Apply attribute changes that can not be applied immediately. Called after scene load or a network update. More...
|
|
virtual bool | SaveDefaultAttributes () const |
| Return whether should save default-valued attributes into XML. Default false. More...
|
|
virtual void | MarkNetworkUpdate () |
| Mark for attribute check on the next network update. More...
|
|
bool | SetAttribute (unsigned index, const Variant &value) |
| Set attribute by index. Return true if successfully set.
|
|
bool | SetAttribute (const String &name, const Variant &value) |
| Set attribute by name. Return true if successfully set.
|
|
void | SetInstanceDefault (bool enable) |
| Set instance-level default flag.
|
|
void | ResetToDefault () |
| Reset all editable attributes to their default values.
|
|
void | RemoveInstanceDefault () |
| Remove instance's default values if they are set previously.
|
|
void | SetTemporary (bool enable) |
| Set temporary flag. Temporary objects will not be saved.
|
|
void | SetInterceptNetworkUpdate (const String &attributeName, bool enable) |
| Enable interception of an attribute from network updates. Intercepted attributes are sent as events instead of applying directly. This can be used to implement client side prediction.
|
|
void | AllocateNetworkState () |
| Allocate network attribute state.
|
|
void | WriteInitialDeltaUpdate (Serializer &dest, unsigned char timeStamp) |
| Write initial delta network update.
|
|
void | WriteDeltaUpdate (Serializer &dest, const DirtyBits &attributeBits, unsigned char timeStamp) |
| Write a delta network update according to dirty attribute bits.
|
|
void | WriteLatestDataUpdate (Serializer &dest, unsigned char timeStamp) |
| Write a latest data network update.
|
|
bool | ReadDeltaUpdate (Deserializer &source) |
| Read and apply a network delta update. Return true if attributes were changed.
|
|
bool | ReadLatestDataUpdate (Deserializer &source) |
| Read and apply a network latest data update. Return true if attributes were changed.
|
|
Variant | GetAttribute (unsigned index) const |
| Return attribute value by index. Return empty if illegal index.
|
|
Variant | GetAttribute (const String &name) const |
| Return attribute value by name. Return empty if not found.
|
|
Variant | GetAttributeDefault (unsigned index) const |
| Return attribute default value by index. Return empty if illegal index.
|
|
Variant | GetAttributeDefault (const String &name) const |
| Return attribute default value by name. Return empty if not found.
|
|
unsigned | GetNumAttributes () const |
| Return number of attributes.
|
|
unsigned | GetNumNetworkAttributes () const |
| Return number of network replication attributes.
|
|
bool | IsTemporary () const |
| Return whether is temporary.
|
|
bool | GetInterceptNetworkUpdate (const String &attributeName) const |
| Return whether an attribute's network updates are being intercepted.
|
|
NetworkState * | GetNetworkState () const |
| Return the network attribute state, if allocated.
|
|
| Object (Context *context) |
| Construct.
|
|
| ~Object () override |
| Destruct. Clean up self from event sender & receiver structures.
|
|
virtual StringHash | GetType () const =0 |
| Return type hash. More...
|
|
virtual const String & | GetTypeName () const =0 |
| Return type name. More...
|
|
virtual const TypeInfo * | GetTypeInfo () const =0 |
| Return type info.
|
|
virtual void | OnEvent (Object *sender, StringHash eventType, VariantMap &eventData) |
| Handle event.
|
|
bool | IsInstanceOf (StringHash type) const |
| Check current instance is type of specified type.
|
|
bool | IsInstanceOf (const TypeInfo *typeInfo) const |
| Check current instance is type of specified type.
|
|
template<typename T > |
bool | IsInstanceOf () const |
| Check current instance is type of specified class.
|
|
template<typename T > |
T * | Cast () |
| Cast the object to specified most derived class.
|
|
template<typename T > |
const T * | Cast () const |
| Cast the object to specified most derived class.
|
|
void | SubscribeToEvent (StringHash eventType, EventHandler *handler) |
| Subscribe to an event that can be sent by any sender.
|
|
void | SubscribeToEvent (Object *sender, StringHash eventType, EventHandler *handler) |
| Subscribe to a specific sender's event.
|
|
void | SubscribeToEvent (StringHash eventType, const std::function< void(StringHash, VariantMap &)> &function, void *userData=nullptr) |
| Subscribe to an event that can be sent by any sender.
|
|
void | SubscribeToEvent (Object *sender, StringHash eventType, const std::function< void(StringHash, VariantMap &)> &function, void *userData=nullptr) |
| Subscribe to a specific sender's event.
|
|
void | UnsubscribeFromEvent (StringHash eventType) |
| Unsubscribe from an event.
|
|
void | UnsubscribeFromEvent (Object *sender, StringHash eventType) |
| Unsubscribe from a specific sender's event.
|
|
void | UnsubscribeFromEvents (Object *sender) |
| Unsubscribe from a specific sender's events.
|
|
void | UnsubscribeFromAllEvents () |
| Unsubscribe from all events.
|
|
void | UnsubscribeFromAllEventsExcept (const Vector< StringHash > &exceptions, bool onlyUserData) |
| Unsubscribe from all events except those listed, and optionally only those with userdata (script registered events).
|
|
void | SendEvent (StringHash eventType) |
| Send event to all subscribers.
|
|
void | SendEvent (StringHash eventType, VariantMap &eventData) |
| Send event with parameters to all subscribers.
|
|
VariantMap & | GetEventDataMap () const |
| Return a preallocated map for event data. Used for optimization to avoid constant re-allocation of event data maps.
|
|
template<typename... Args> |
void | SendEvent (StringHash eventType, Args... args) |
| Send event with variadic parameter pairs to all subscribers. The parameter pairs is a list of paramID and paramValue separated by comma, one pair after another.
|
|
Context * | GetContext () const |
| Return execution context.
|
|
const Variant & | GetGlobalVar (StringHash key) const |
| Return global variable based on key.
|
|
const VariantMap & | GetGlobalVars () const |
| Return all global variables.
|
|
void | SetGlobalVar (StringHash key, const Variant &value) |
| Set global variable with the respective key and value.
|
|
Object * | GetSubsystem (StringHash type) const |
| Return subsystem by type.
|
|
Object * | GetEventSender () const |
| Return active event sender. Null outside event handling.
|
|
EventHandler * | GetEventHandler () const |
| Return active event handler. Null outside event handling.
|
|
bool | HasSubscribedToEvent (StringHash eventType) const |
| Return whether has subscribed to an event without specific sender.
|
|
bool | HasSubscribedToEvent (Object *sender, StringHash eventType) const |
| Return whether has subscribed to a specific sender's event.
|
|
bool | HasEventHandlers () const |
| Return whether has subscribed to any event.
|
|
template<class T > |
T * | GetSubsystem () const |
| Template version of returning a subsystem.
|
|
const String & | GetCategory () const |
| Return object category. Categories are (optionally) registered along with the object factory. Return an empty string if the object category is not registered.
|
|
void | SetBlockEvents (bool block) |
| Block object from sending and receiving events.
|
|
bool | GetBlockEvents () const |
| Return sending and receiving events blocking status.
|
|
| RefCounted () |
| Construct. Allocate the reference count structure and set an initial self weak reference.
|
|
virtual | ~RefCounted () |
| Destruct. Mark as expired and also delete the reference count structure if no outside weak references exist.
|
|
| RefCounted (const RefCounted &rhs)=delete |
| Prevent copy construction.
|
|
RefCounted & | operator= (const RefCounted &rhs)=delete |
| Prevent assignment.
|
|
void | AddRef () |
| Increment reference count. Can also be called outside of a SharedPtr for traditional reference counting.
|
|
void | ReleaseRef () |
| Decrement reference count and delete self if no more references. Can also be called outside of a SharedPtr for traditional reference counting.
|
|
int | Refs () const |
| Return reference count.
|
|
int | WeakRefs () const |
| Return weak reference count.
|
|
RefCount * | RefCountPtr () |
| Return pointer to the reference count structure.
|
|