Rebel Fork Framework
Urho3D::UIElement Class Reference

Base class for UI elements. More...

#include <Urho3D/UI/UIElement.h>

Inheritance diagram for Urho3D::UIElement:
Urho3D::Animatable Urho3D::Serializable Urho3D::Object Urho3D::RefCounted Urho3D::BorderImage Urho3D::ScrollView Urho3D::Sprite Urho3D::ToolTip Urho3D::UISelectable Urho3D::Button Urho3D::CheckBox Urho3D::Cursor Urho3D::LineEdit Urho3D::ProgressBar Urho3D::ScrollBar Urho3D::Slider Urho3D::Window Urho3D::ListView Urho3D::Text

Public Member Functions

 UIElement (Context *context)
 Construct.
 
 ~UIElement () override
 Destruct.
 
void ApplyAttributes () override
 Apply attribute changes that can not be applied immediately.
 
bool LoadXML (const XMLElement &source) override
 Load from XML data. Return true if successful.
 
virtual bool LoadXML (const XMLElement &source, XMLFile *styleFile)
 Load from XML data with style. Return true if successful.
 
virtual UIElementLoadChildXML (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.
 
virtual void Update (float timeStep)
 Perform UI element update.
 
virtual bool IsWithinScissor (const IntRect &currentScissor)
 Return whether is visible and inside a scissor rectangle and should be rendered.
 
virtual const IntVector2GetScreenPosition () const
 
virtual void GetBatches (ea::vector< UIBatch > &batches, ea::vector< float > &vertexData, const IntRect &currentScissor)
 Return UI rendering batches.
 
virtual void GetDebugDrawBatches (ea::vector< UIBatch > &batches, ea::vector< float > &vertexData, const IntRect &currentScissor)
 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.
 
virtual void OnClickBegin (const IntVector2 &position, const IntVector2 &screenPosition, MouseButton button, MouseButtonFlags buttons, QualifierFlags qualifiers, Cursor *cursor)
 React to mouse click begin.
 
virtual void OnClickEnd (const IntVector2 &position, const IntVector2 &screenPosition, MouseButton button, MouseButtonFlags buttons, QualifierFlags qualifiers, Cursor *cursor, UIElement *beginElement)
 React to mouse click end.
 
virtual void OnDoubleClick (const IntVector2 &position, const IntVector2 &screenPosition, MouseButton button, MouseButtonFlags buttons, QualifierFlags qualifiers, Cursor *cursor)
 React to double mouse click.
 
virtual void OnDragBegin (const IntVector2 &position, const IntVector2 &screenPosition, MouseButtonFlags buttons, QualifierFlags qualifiers, Cursor *cursor)
 React to mouse drag begin.
 
virtual void OnDragMove (const IntVector2 &position, const IntVector2 &screenPosition, const IntVector2 &deltaPos, MouseButtonFlags buttons, QualifierFlags qualifiers, Cursor *cursor)
 React to mouse drag motion.
 
virtual void OnDragEnd (const IntVector2 &position, const IntVector2 &screenPosition, MouseButtonFlags dragButtons, MouseButtonFlags releaseButtons, Cursor *cursor)
 React to mouse drag end.
 
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).
 
virtual bool OnDragDropTest (UIElement *source)
 React to drag and drop test. Return true to signal that the drop is acceptable.
 
virtual bool OnDragDropFinish (UIElement *source)
 React to drag and drop finish. Return true to signal that the drop was accepted.
 
virtual void OnWheel (int delta, MouseButtonFlags buttons, QualifierFlags qualifiers)
 React to mouse wheel.
 
virtual void OnKey (Key key, MouseButtonFlags buttons, QualifierFlags qualifiers)
 React to a key press.
 
virtual void OnTextInput (const ea::string &text)
 React to text input event.
 
virtual void OnResize (const IntVector2 &newSize, const IntVector2 &delta)
 React to resize.
 
virtual void OnPositionSet (const IntVector2 &newPosition)
 React to position change.
 
virtual void OnSetEditable ()
 React to editable status change.
 
virtual void OnIndentSet ()
 React to indent change.
 
virtual IntVector2 ScreenToElement (const IntVector2 &screenPosition)
 Convert screen coordinates to element coordinates.
 
virtual IntVector2 ElementToScreen (const IntVector2 &position)
 Convert element coordinates to screen coordinates.
 
virtual bool IsWheelHandler () const
 Return whether the element could handle wheel input.
 
bool LoadXML (Deserializer &source)
 Load from an XML file. Return true if successful.
 
bool SaveXML (Serializer &dest, const ea::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 ea::string &name)
 
void SetPosition (const IntVector2 &position)
 
void SetPosition (int x, int y)
 Set position.
 
void SetSize (const IntVector2 &size)
 
void SetSize (int width, int height)
 Set size.
 
void SetWidth (int width)
 
void SetHeight (int height)
 
void SetMinSize (const IntVector2 &minSize)
 
void SetMinSize (int width, int height)
 Set minimum size.
 
void SetMinWidth (int width)
 
void SetMinHeight (int height)
 
void SetMaxSize (const IntVector2 &maxSize)
 
void SetMaxSize (int width, int height)
 Set maximum size.
 
void SetMaxWidth (int width)
 
void SetMaxHeight (int 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)
 
void SetVerticalAlignment (VerticalAlignment align)
 
void SetEnableAnchor (bool enable)
 
void SetMinAnchor (const Vector2 &anchor)
 
void SetMinAnchor (float x, float y)
 Set minimum anchor.
 
void SetMaxAnchor (const Vector2 &anchor)
 
void SetMaxAnchor (float x, float y)
 Set maximum anchor.
 
void SetMinOffset (const IntVector2 &offset)
 
void SetMaxOffset (const IntVector2 &offset)
 
void SetPivot (const Vector2 &pivot)
 
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)
 
void SetColor (const Color &color)
 
void SetColor (Corner corner, const Color &color)
 
void SetPriority (int priority)
 
void SetOpacity (float opacity)
 
void SetBringToFront (bool enable)
 
void SetBringToBack (bool enable)
 
void SetClipChildren (bool enable)
 
void SetSortChildren (bool enable)
 
void SetUseDerivedOpacity (bool enable)
 
void SetEnabled (bool enable)
 
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)
 
void SetFocus (bool enable)
 
void SetSelected (bool enable)
 
void SetVisible (bool enable)
 
void SetFocusMode (FocusMode mode)
 
void SetDragDropMode (DragAndDropModeFlags mode)
 
bool SetStyle (const ea::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)
 
void SetLayout (LayoutMode mode, int spacing=0, const IntRect &border=IntRect::ZERO)
 Set layout parameters.
 
void SetLayoutMode (LayoutMode mode)
 
void SetLayoutSpacing (int spacing)
 
void SetLayoutBorder (const IntRect &border)
 
void SetLayoutFlexScale (const Vector2 &scale)
 
void SetIndent (int indent)
 
void SetIndentSpacing (int indentSpacing)
 
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.
 
UIElementCreateChild (StringHash type, const ea::string &name=EMPTY_STRING, unsigned index=M_MAX_UNSIGNED)
 Create and add a child element and return it.
 
void AddChild (UIElement *element)
 Add a child element.
 
void InsertChild (unsigned index, UIElement *element)
 Insert a child element into a specific position in the child list.
 
void RemoveChild (UIElement *element, unsigned index=0)
 Remove a child element. Starting search at specified index if provided.
 
void RemoveChildAtIndex (unsigned 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.
 
unsigned FindChild (UIElement *element) const
 Find child index. Return M_MAX_UNSIGNED if not found.
 
void SetParent (UIElement *parent, unsigned index=M_MAX_UNSIGNED)
 Set parent element. Same as parent->InsertChild(index, this).
 
void SetVar (const ea::string &key, const Variant &value)
 Set a user variable.
 
void SetVarByHash (StringHash hash, const Variant &value)
 
void SetInternal (bool enable)
 
void SetTraversalMode (TraversalMode traversalMode)
 
void SetElementEventSender (bool flag)
 
void SetTags (const StringVector &tags)
 Set tags. Old tags are overwritten.
 
void AddTag (const ea::string &tag)
 Add a tag.
 
void AddTags (const ea::string &tags, char separator=';')
 Add tags with the specified separator (; by default).
 
void AddTags (const StringVector &tags)
 Add tags.
 
bool RemoveTag (const ea::string &tag)
 Remove specific tag. Return true if existed.
 
void RemoveAllTags ()
 Remove all tags.
 
template<class T >
T * CreateChild (const ea::string &name=EMPTY_STRING, unsigned index=M_MAX_UNSIGNED)
 Template version of creating a child element.
 
template<class T >
T * GetChildStaticCast (unsigned index) const
 Template version of returning child element by index using static cast.
 
template<class T >
T * GetChildStaticCast (const ea::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 (unsigned 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 ea::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 ea::string & GetName () const
 
const IntVector2GetPosition () const
 
const IntVector2GetSize () const
 
int GetWidth () const
 
int GetHeight () const
 
const IntVector2GetMinSize () const
 
int GetMinWidth () const
 
int GetMinHeight () const
 
const IntVector2GetMaxSize () const
 
int GetMaxWidth () const
 
int GetMaxHeight () const
 
bool IsFixedSize () const
 
bool IsFixedWidth () const
 
bool IsFixedHeight () const
 
const IntVector2GetChildOffset () const
 
HorizontalAlignment GetHorizontalAlignment () const
 
VerticalAlignment GetVerticalAlignment () const
 
bool GetEnableAnchor () const
 
const Vector2GetMinAnchor () const
 
const Vector2GetMaxAnchor () const
 
const IntVector2GetMinOffset () const
 
const IntVector2GetMaxOffset () const
 
const Vector2GetPivot () const
 
const IntRectGetClipBorder () const
 
const ColorGetColor (Corner corner) const
 
int GetPriority () const
 
float GetOpacity () const
 
float GetDerivedOpacity () const
 
bool GetBringToFront () const
 
bool GetBringToBack () const
 
bool GetClipChildren () const
 
bool GetSortChildren () const
 
bool GetUseDerivedOpacity () const
 
bool HasFocus () const
 
bool IsChildOf (UIElement *element) const
 Return whether is a direct or indirect child of specified element.
 
bool IsEnabled () const
 
bool IsEnabledSelf () const
 
bool IsEditable () const
 
bool IsSelected () const
 
bool IsVisible () const
 
bool IsVisibleEffective () const
 
bool IsHovering () const
 
bool IsInternal () const
 
bool HasColorGradient () const
 
FocusMode GetFocusMode () const
 
DragAndDropModeFlags GetDragDropMode () const
 
const ea::string & GetAppliedStyle () const
 
XMLFileGetDefaultStyle (bool recursiveUp=true) const
 Return default style.
 
LayoutMode GetLayoutMode () const
 
int GetLayoutSpacing () const
 
const IntRectGetLayoutBorder () const
 
const Vector2GetLayoutFlexScale () const
 
unsigned GetNumChildren (bool recursive=false) const
 Return number of child elements.
 
UIElementGetChild (unsigned index) const
 
UIElementGetChild (const ea::string &name, bool recursive=false) const
 Return child element by name.
 
UIElementGetChild (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 ea::vector< SharedPtr< UIElement > > & GetChildren () const
 Return immediate child elements.
 
void GetChildren (ea::vector< UIElement * > &dest, bool recursive=false) const
 Return child elements either recursively or non-recursively.
 
ea::vector< UIElement * > GetChildren (bool recursive) const
 Return child elements, optionally recursive.
 
UIElementGetParent () const
 
UIElementGetRoot () const
 
const ColorGetDerivedColor () const
 Return derived color. Only valid when no gradient.
 
const VariantGetVar (const ea::string &key) const
 Return a user variable.
 
const VariantGetVarByHash (StringHash key) const
 
const StringVariantMapGetVars () const
 Return all user variables.
 
bool HasTag (const ea::string &tag) const
 Return whether element is tagged by a specific tag.
 
const StringVectorGetTags () const
 
void GetChildrenWithTag (ea::vector< UIElement * > &dest, const ea::string &tag, bool recursive=false) const
 Return child elements with a specific tag either recursively or non-recursively.
 
ea::vector< UIElement * > GetChildrenWithTag (const ea::string &tag, bool recursive=false) const
 Return child elements with a specific tag either recursively or non-recursively.
 
MouseButtonFlags GetDragButtonCombo () const
 
unsigned GetDragButtonCount () const
 
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 ()
 
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
 
int GetIndentSpacing () const
 
int GetIndentWidth () const
 
void SetChildOffset (const IntVector2 &offset)
 Set child offset.
 
void SetHovering (bool enable)
 Set hovering state.
 
void AdjustScissor (IntRect &currentScissor)
 Adjust scissor for rendering.
 
void GetBatchesWithOffset (IntVector2 &offset, ea::vector< UIBatch > &batches, ea::vector< float > &vertexData, IntRect currentScissor)
 Get UI rendering batches with a specified offset. Also recurse to child elements.
 
const ColorGetColorAttr () const
 Return color attribute. Uses just the top-left color.
 
TraversalMode GetTraversalMode () const
 
bool IsElementEventSender () const
 
UIElementGetElementEventSender () const
 Get element which should send child added / removed events.
 
IntVector2 GetEffectiveMinSize () const
 Return effective minimum size, also considering layout. Used internally.
 
- Public Member Functions inherited from Urho3D::Animatable
 Animatable (Context *context)
 Construct.
 
 ~Animatable () override
 Destruct.
 
bool LoadJSON (const JSONValue &source) override
 Load from JSON data. Return true if successful.
 
bool SaveJSON (JSONValue &dest) const override
 Save as JSON data. Return true if successful.
 
void SetAnimationEnabled (bool enable)
 
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)
 
void SetAttributeAnimation (const ea::string &name, ValueAnimation *attributeAnimation, WrapMode wrapMode=WM_LOOP, float speed=1.0f)
 Set attribute animation.
 
void SetAttributeAnimationWrapMode (const ea::string &name, WrapMode wrapMode)
 Set attribute animation wrap mode.
 
void SetAttributeAnimationSpeed (const ea::string &name, float speed)
 Set attribute animation speed.
 
void SetAttributeAnimationTime (const ea::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 ea::string &name)
 Remove attribute animation. Same as calling SetAttributeAnimation with a null pointer.
 
bool GetAnimationEnabled () const
 
ObjectAnimationGetObjectAnimation () const
 
ValueAnimationGetAttributeAnimation (const ea::string &name) const
 Return attribute animation.
 
WrapMode GetAttributeAnimationWrapMode (const ea::string &name) const
 Return attribute animation wrap mode.
 
float GetAttributeAnimationSpeed (const ea::string &name) const
 Return attribute animation speed.
 
float GetAttributeAnimationTime (const ea::string &name) const
 Return attribute animation time position.
 
void SetObjectAnimationAttr (const ResourceRef &value)
 Set object animation attribute.
 
ResourceRef GetObjectAnimationAttr () const
 Return object animation attribute.
 
- Public Member Functions inherited from Urho3D::Serializable
 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 ObjectReflectionGetReflection () const
 Return reflection used for serialization.
 
virtual const ea::vector< AttributeInfo > * GetAttributes () const
 Return attribute descriptions, or null if none defined.
 
void SerializeInBlock (Archive &archive) override
 Serialize content from/to archive. May throw ArchiveException.
 
void SerializeInBlock (Archive &archive, bool serializeTemporary)
 
virtual bool Load (Deserializer &source)
 Load from binary data. Return true if successful.
 
virtual bool Save (Serializer &dest) const
 Save as binary data. Return true if successful.
 
virtual bool Load (const ea::string &resourceName)
 Load from binary resource.
 
virtual bool LoadXML (const ea::string &resourceName)
 Load from XML resource.
 
virtual bool LoadJSON (const ea::string &resourceName)
 Load from JSON resource.
 
virtual bool LoadFile (const ea::string &resourceName)
 Load from resource of automatically detected type.
 
virtual bool SaveDefaultAttributes (const AttributeInfo &attr) const
 Return whether should save default-valued attributes into XML. Default false.
 
bool SetAttribute (unsigned index, const Variant &value)
 
bool SetAttribute (const ea::string &name, const Variant &value)
 Set attribute by name. Return true if successfully set.
 
void SetInstanceDefault (bool enable)
 (Internal use) Set instance-level default flag.
 
void SetInstanceDefault (const ea::string &name, const Variant &defaultValue)
 (Internal use) Set instance-level default value. Allocate the internal data structure as necessary.
 
virtual Variant GetInstanceDefault (const ea::string &name) const
 (Internal use) Get instance-level default value.
 
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)
 
Variant GetAttribute (unsigned index) const
 
Variant GetAttribute (const ea::string &name) const
 Return attribute value by name. Return empty if not found.
 
Variant GetAttributeDefault (unsigned index) const
 
Variant GetAttributeDefault (const ea::string &name) const
 Return attribute default value by name. Return empty if not found.
 
unsigned GetNumAttributes () const
 
void CopyAttributes (const Serializable *source, bool resetToDefault=true)
 Copy all attributes from another serializable.
 
SharedPtr< SerializableClone (bool resetToDefault=true) const
 Clone this serializable.
 
bool IsTemporary () const
 
- Public Member Functions inherited from Urho3D::Object
 Object (Context *context)
 Construct.
 
 ~Object () override
 Destruct. Clean up self from event sender & receiver structures.
 
virtual StringHash GetType () const =0
 
virtual const ea::string & GetTypeName () const =0
 
virtual const TypeInfoGetTypeInfo () const =0
 Return type info.
 
virtual bool IsInstanceOf (StringHash type) const =0
 Check whether current instance implements specified type.
 
virtual void OnEvent (Object *sender, StringHash eventType, VariantMap &eventData)
 Handle event.
 
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 SubscribeToEventManual (StringHash eventType, EventHandler *handler)
 Subscribe to an event that can be sent by any sender.
 
void SubscribeToEventManual (Object *sender, StringHash eventType, EventHandler *handler)
 Subscribe to a specific sender's event.
 
template<class T >
void SubscribeToEvent (StringHash eventType, T handler)
 Subscribe to an event that can be sent by any sender.
 
template<class T >
void SubscribeToEvent (Object *sender, StringHash eventType, T handler)
 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 ea::vector< StringHash > &exceptions)
 Unsubscribe from all events except those listed.
 
void UnsubscribeFromAllEventsExcept (const ea::vector< Object * > &exceptions)
 Unsubscribe from all events except those with listed senders.
 
void SendEvent (StringHash eventType)
 Send event to all subscribers.
 
void SendEvent (StringHash eventType, VariantMap &eventData)
 Send event with parameters to all subscribers.
 
VariantMapGetEventDataMap () 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, const Args &... args)
 Send event with variadic parameter pairs to all subscribers. The parameters are (paramID, paramValue) pairs.
 
ContextGetContext () const
 Return execution context.
 
const VariantGetGlobalVar (StringHash key) const
 
const VariantMapGetGlobalVars () const
 
void SetGlobalVar (StringHash key, const Variant &value)
 
ObjectGetSubsystem (StringHash type) const
 Return subsystem by type.
 
ObjectGetEventSender () const
 Return active event sender. Null outside event handling.
 
EventHandlerGetEventHandler () 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 ea::string & GetCategory () const
 
void SendEvent (StringHash eventType, const VariantMap &eventData)
 Send event with parameters to all subscribers.
 
void SetBlockEvents (bool block)
 Block object from sending and receiving events.
 
bool GetBlockEvents () const
 Return sending and receiving events blocking status.
 
- Public Member Functions inherited from Urho3D::RefCounted
 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.
 
RefCountedoperator= (const RefCounted &rhs)=delete
 Prevent assignment.
 
int AddRef ()
 
int ReleaseRef ()
 
int Refs () const
 
int WeakRefs () const
 
RefCountRefCountPtr () const
 Return pointer to the reference count structure.
 
bool HasScriptObject () const
 Return true if script runtime object wrapping this native object exists.
 
bool IsScriptStrongRef () const
 Return true if script reference is strong.
 

Static Public Member Functions

static void RegisterObject (Context *context)
 
- Static Public Member Functions inherited from Urho3D::Animatable
static void RegisterObject (Context *context)
 
- Static Public Member Functions inherited from Urho3D::Object
static const TypeInfoGetTypeInfoStatic ()
 Return type info static.
 

Protected Member Functions

void OnAttributeAnimationAdded () override
 Handle attribute animation added.
 
void OnAttributeAnimationRemoved () override
 Handle attribute animation removed.
 
AnimatableFindAttributeAnimationTarget (const ea::string &name, ea::string &outName) override
 Find target of an attribute animation from object hierarchy by name.
 
void MarkDirty ()
 Mark screen position as needing an update.
 
bool RemoveChildXML (XMLElement &parent, const ea::string &name) const
 Remove child XML element by matching attribute name.
 
bool RemoveChildXML (XMLElement &parent, const ea::string &name, const ea::string &value) const
 Remove child XML element by matching attribute name and value.
 
bool FilterUIStyleAttributes (XMLElement &dest, const XMLElement &styleElem) const
 Filter UI-style attributes in serialization process.
 
virtual bool FilterImplicitAttributes (XMLElement &dest) const
 Filter implicit attributes in serialization process.
 
void UpdateAnchoring ()
 Update anchored size & position. Only called when anchoring is enabled.
 
- Protected Member Functions inherited from Urho3D::Animatable
void SetObjectAttributeAnimation (const ea::string &name, ValueAnimation *attributeAnimation, WrapMode wrapMode, float speed)
 Set object attribute animation internal.
 
void OnObjectAnimationAdded (ObjectAnimation *objectAnimation)
 Handle object animation added.
 
void OnObjectAnimationRemoved (ObjectAnimation *objectAnimation)
 Handle object animation removed.
 
void UpdateAttributeAnimations (float timeStep)
 Update attribute animations.
 
AttributeAnimationInfoGetAttributeAnimationInfo (const ea::string &name) const
 Return attribute animation info.
 
void HandleAttributeAnimationAdded (StringHash eventType, VariantMap &eventData)
 Handle attribute animation added.
 
void HandleAttributeAnimationRemoved (StringHash eventType, VariantMap &eventData)
 Handle attribute animation removed.
 

Protected Attributes

ea::string name_
 Name.
 
ea::vector< SharedPtr< UIElement > > children_
 Child elements.
 
UIElementparent_ {}
 Parent element.
 
IntRect clipBorder_
 Child element clipping border.
 
Color colors_ [MAX_UIELEMENT_CORNERS]
 Colors.
 
StringVariantMap vars_
 User variables.
 
int priority_ {}
 Priority.
 
bool bringToFront_ {}
 Bring to front when focused flag.
 
bool bringToBack_ {true}
 Bring to back when defocused flag.
 
bool clipChildren_ {}
 Clip children flag.
 
bool sortChildren_ {true}
 Sort children according to priority flag.
 
bool useDerivedOpacity_ {true}
 Use derived opacity flag.
 
bool enabled_ {}
 Input enabled flag.
 
bool enabledPrev_ {}
 Last SetEnabled flag before any SetDeepEnabled.
 
bool editable_ {true}
 Value editable flag.
 
bool selected_ {}
 Selected flag.
 
bool visible_ {true}
 Visible flag.
 
bool hovering_ {}
 Hovering flag.
 
bool internal_ {}
 Internally created flag.
 
FocusMode focusMode_ {FM_NOTFOCUSABLE}
 Focus mode.
 
DragAndDropModeFlags dragDropMode_ {DD_DISABLED}
 Drag and drop flags.
 
LayoutMode layoutMode_ {LM_FREE}
 Layout mode.
 
int layoutSpacing_ {}
 Layout spacing.
 
IntRect layoutBorder_ {}
 Layout borders.
 
Vector2 layoutFlexScale_ {Vector2::ONE}
 Layout flex scale.
 
unsigned resizeNestingLevel_ {}
 Resize nesting level to prevent multiple events and endless loop.
 
unsigned layoutNestingLevel_ {}
 Layout update nesting level to prevent endless loop.
 
int layoutElementMaxSize_ {}
 Layout element maximum size in layout direction.
 
int indent_ {}
 Horizontal indentation.
 
int indentSpacing_ {16}
 Indent spacing (number of pixels per indentation level).
 
IntVector2 position_ {}
 Position.
 
IntVector2 screenPosition_
 Screen position.
 
bool positionDirty_ {true}
 Screen position dirty flag.
 
ea::string appliedStyle_
 Applied style.
 
MouseButtonFlags dragButtonCombo_ {}
 Drag button combo.
 
unsigned dragButtonCount_ {}
 Drag button count.
 
- Protected Attributes inherited from Urho3D::Animatable
bool animationEnabled_
 Animation enabled.
 
SharedPtr< ObjectAnimationobjectAnimation_
 Animation.
 
ea::unordered_map< ea::string, SharedPtr< AttributeAnimationInfo > > attributeAnimationInfos_
 Attribute animation infos.
 
- Protected Attributes inherited from Urho3D::Serializable
ea::unique_ptr< VariantMapinstanceDefaultValues_
 Attribute default value at each instance level.
 
bool setInstanceDefault_
 When true, store the attribute value as instance's default value (internal use only).
 
bool temporary_
 Temporary flag.
 
- Protected Attributes inherited from Urho3D::Object
WeakPtr< Contextcontext_
 Execution context.
 

Private Member Functions

 URHO3D_OBJECT (UIElement, Animatable)
 
void GetChildrenRecursive (ea::vector< UIElement * > &dest) const
 Return child elements recursively.
 
void GetChildrenWithTagRecursive (ea::vector< UIElement * > &dest, const ea::string &tag) const
 Return child elements with a specific tag recursively.
 
void ApplyStyleRecursive (UIElement *element)
 Recursively apply style to a child element hierarchy when adding to an element.
 
int CalculateLayoutParentSize (const ea::vector< int > &sizes, int begin, int end, int spacing)
 Calculate layout width for resizing the parent element.
 
void CalculateLayout (ea::vector< int > &positions, ea::vector< int > &sizes, const ea::vector< int > &minSizes, const ea::vector< int > &maxSizes, const ea::vector< float > &flexScales, int targetSize, int begin, int end, int spacing)
 Calculate child widths/positions in the layout.
 
IntVector2 GetLayoutChildPosition (UIElement *child)
 Get child element constant position in a layout.
 
void Detach ()
 Detach from parent.
 
void VerifyChildAlignment ()
 Verify that child elements have proper alignment for layout mode.
 
void HandlePostUpdate (StringHash eventType, VariantMap &eventData)
 Handle logic post-update event.
 

Private Attributes

IntVector2 size_
 Size.
 
IntVector2 minSize_
 Minimum size.
 
IntVector2 maxSize_ {M_MAX_INT, M_MAX_INT}
 Maximum size.
 
IntVector2 childOffset_
 Child elements' offset. Used internally.
 
IntVector2 layoutMinSize_
 Parent's minimum size calculated by layout. Used internally.
 
IntVector2 minOffset_
 Minimum offset.
 
IntVector2 maxOffset_
 Maximum offset.
 
bool enableAnchor_ {}
 Use min/max anchor & min/max offset for position & size instead of setting explicitly.
 
bool pivotSet_ {}
 Has pivot changed manually.
 
Vector2 anchorMin_
 Anchor minimum position.
 
Vector2 anchorMax_
 Anchor maximum position.
 
Vector2 pivot_
 Pivot Position.
 
float opacity_ {1.0f}
 Opacity.
 
float derivedOpacity_ {}
 Derived opacity.
 
Color derivedColor_
 Derived color. Only valid when no gradient.
 
bool opacityDirty_ {true}
 Derived opacity dirty flag.
 
bool derivedColorDirty_ {true}
 Derived color dirty flag (only used when no gradient).
 
bool sortOrderDirty_ {}
 Child priority sorting dirty flag.
 
bool colorGradient_ {}
 Has color gradient flag.
 
SharedPtr< XMLFiledefaultStyle_
 Default style file.
 
WeakPtr< XMLFileappliedStyleFile_
 Last applied style file.
 
ea::string defaultStyleFileName_
 Style resource name which is loaded by default.
 
TraversalMode traversalMode_ {TM_BREADTH_FIRST}
 Traversal mode for rendering.
 
bool elementEventSender_ {}
 Flag whether node should send child added / removed events by itself.
 
StringVector tags_
 Tag list.
 

Additional Inherited Members

- Static Public Attributes inherited from Urho3D::Object
static constexpr ea::array< StringHash, 0 > TypeHierarchy {}
 

Detailed Description

Base class for UI elements.

Member Function Documentation

◆ GetAppliedStyle()

const ea::string & Urho3D::UIElement::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).

◆ GetBringToBack()

bool Urho3D::UIElement::GetBringToBack ( ) const
inline

Return whether should be put to background when another element is focused.

◆ GetBringToFront()

bool Urho3D::UIElement::GetBringToFront ( ) const
inline

Return whether should be brought to front when focused.

◆ GetChild()

UIElement * Urho3D::UIElement::GetChild ( unsigned  index) const

Return child element by index.

◆ GetChildOffset()

const IntVector2& Urho3D::UIElement::GetChildOffset ( ) const
inline

Return child element offset.

◆ GetClipBorder()

const IntRect& Urho3D::UIElement::GetClipBorder ( ) const
inline

Return child element clipping border.

◆ GetClipChildren()

bool Urho3D::UIElement::GetClipChildren ( ) const
inline

Return whether should clip child elements.

◆ GetColor()

const Color& Urho3D::UIElement::GetColor ( Corner  corner) const
inline

Return corner color.

◆ GetCombinedScreenRect()

IntRect Urho3D::UIElement::GetCombinedScreenRect ( )

Return combined screen coordinate rect of element and its children.

◆ GetDerivedOpacity()

float Urho3D::UIElement::GetDerivedOpacity ( ) const

Return derived opacity (affected by parent elements). If UseDerivedOpacity is false, returns same as element's own opacity.

◆ GetDragButtonCombo()

MouseButtonFlags Urho3D::UIElement::GetDragButtonCombo ( ) const
inline

Return the drag button combo if this element is being dragged.

◆ GetDragButtonCount()

unsigned Urho3D::UIElement::GetDragButtonCount ( ) const
inline

Return the number of buttons dragging this element.

◆ GetDragDropMode()

DragAndDropModeFlags Urho3D::UIElement::GetDragDropMode ( ) const
inline

Return drag and drop flags.

◆ GetEnableAnchor()

bool Urho3D::UIElement::GetEnableAnchor ( ) const
inline

Return whether anchor positioning & sizing is enabled.

◆ GetFocusMode()

FocusMode Urho3D::UIElement::GetFocusMode ( ) const
inline

Return focus mode.

◆ GetHeight()

int Urho3D::UIElement::GetHeight ( ) const
inline

Return height.

◆ GetHorizontalAlignment()

HorizontalAlignment Urho3D::UIElement::GetHorizontalAlignment ( ) const

Return horizontal alignment. If pivot has been adjusted to a custom horizontal setting, returns HA_CUSTOM.

◆ GetIndent()

int Urho3D::UIElement::GetIndent ( ) const
inline

Return horizontal indentation.

◆ GetIndentSpacing()

int Urho3D::UIElement::GetIndentSpacing ( ) const
inline

Return indent spacing (number of pixels per indentation level).

◆ GetIndentWidth()

int Urho3D::UIElement::GetIndentWidth ( ) const
inline

Return indent width in pixels.

◆ GetLayoutBorder()

const IntRect& Urho3D::UIElement::GetLayoutBorder ( ) const
inline

Return layout border.

◆ GetLayoutFlexScale()

const Vector2& Urho3D::UIElement::GetLayoutFlexScale ( ) const
inline

Return layout flex scale.

◆ GetLayoutMode()

LayoutMode Urho3D::UIElement::GetLayoutMode ( ) const
inline

Return layout mode.

◆ GetLayoutSpacing()

int Urho3D::UIElement::GetLayoutSpacing ( ) const
inline

Return layout spacing.

◆ GetMaxAnchor()

const Vector2& Urho3D::UIElement::GetMaxAnchor ( ) const
inline

Return maximum anchor.

◆ GetMaxHeight()

int Urho3D::UIElement::GetMaxHeight ( ) const
inline

Return minimum height.

◆ GetMaxSize()

const IntVector2& Urho3D::UIElement::GetMaxSize ( ) const
inline

Return maximum size.

◆ GetMaxWidth()

int Urho3D::UIElement::GetMaxWidth ( ) const
inline

Return minimum width.

◆ GetMinAnchor()

const Vector2& Urho3D::UIElement::GetMinAnchor ( ) const
inline

Return minimum anchor.

◆ GetMinHeight()

int Urho3D::UIElement::GetMinHeight ( ) const
inline

Return minimum height.

◆ GetMinSize()

const IntVector2& Urho3D::UIElement::GetMinSize ( ) const
inline

Return minimum size.

◆ GetMinWidth()

int Urho3D::UIElement::GetMinWidth ( ) const
inline

Return minimum width.

◆ GetName()

const ea::string& Urho3D::UIElement::GetName ( ) const
inline

Return name.

◆ GetOpacity()

float Urho3D::UIElement::GetOpacity ( ) const
inline

Return opacity.

◆ GetParent()

UIElement* Urho3D::UIElement::GetParent ( ) const
inline

Return parent element.

◆ GetPivot()

const Vector2& Urho3D::UIElement::GetPivot ( ) const
inline

Return pivot.

◆ GetPosition()

const IntVector2& Urho3D::UIElement::GetPosition ( ) const
inline

Return position.

◆ GetPriority()

int Urho3D::UIElement::GetPriority ( ) const
inline

Return priority.

◆ GetRoot()

UIElement * Urho3D::UIElement::GetRoot ( ) const

Return root element.

◆ GetScreenPosition()

const IntVector2 & Urho3D::UIElement::GetScreenPosition ( ) const
virtual

Update and return screen position.

Reimplemented in Urho3D::Sprite.

◆ GetSize()

const IntVector2& Urho3D::UIElement::GetSize ( ) const
inline

Return size.

◆ GetSortChildren()

bool Urho3D::UIElement::GetSortChildren ( ) const
inline

Return whether should sort child elements according to priority.

◆ GetTags()

const StringVector& Urho3D::UIElement::GetTags ( ) const
inline

Return all tags.

◆ GetTraversalMode()

TraversalMode Urho3D::UIElement::GetTraversalMode ( ) const
inline

Return traversal mode for rendering.

◆ GetUseDerivedOpacity()

bool Urho3D::UIElement::GetUseDerivedOpacity ( ) const
inline

Return whether parent elements' opacity affects opacity.

◆ GetVerticalAlignment()

VerticalAlignment Urho3D::UIElement::GetVerticalAlignment ( ) const

Return vertical alignment. If pivot has been adjusted to a custom vertical setting, returns VA_CUSTOM.

◆ GetWidth()

int Urho3D::UIElement::GetWidth ( ) const
inline

Return width.

◆ HasColorGradient()

bool Urho3D::UIElement::HasColorGradient ( ) const
inline

Return whether has different color in at least one corner.

◆ HasFocus()

bool Urho3D::UIElement::HasFocus ( ) const

Return whether has focus.

◆ IsEditable()

bool Urho3D::UIElement::IsEditable ( ) const
inline

Return whether value is editable through input.

◆ IsElementEventSender()

bool Urho3D::UIElement::IsElementEventSender ( ) const
inline

Return whether element should send child added / removed events by itself. If false, defers to parent element.

◆ IsEnabled()

bool Urho3D::UIElement::IsEnabled ( ) const
inline

Return whether reacts to input.

◆ IsEnabledSelf()

bool Urho3D::UIElement::IsEnabledSelf ( ) const
inline

Returns the element's last own enabled state. May be different than the value returned by IsEnabled when SetDeepEnabled has been used.

◆ IsFixedHeight()

bool Urho3D::UIElement::IsFixedHeight ( ) const
inline

Return true if height is fixed.

◆ IsFixedSize()

bool Urho3D::UIElement::IsFixedSize ( ) const
inline

Return true if size is fixed.

◆ IsFixedWidth()

bool Urho3D::UIElement::IsFixedWidth ( ) const
inline

Return true if width is fixed.

◆ IsHovering()

bool Urho3D::UIElement::IsHovering ( ) const
inline

Return whether the cursor is hovering on this element.

◆ IsInternal()

bool Urho3D::UIElement::IsInternal ( ) const
inline

Return whether is internally created.

◆ IsSelected()

bool Urho3D::UIElement::IsSelected ( ) const
inline

Return whether is selected. Actual meaning is element dependent.

◆ IsVisible()

bool Urho3D::UIElement::IsVisible ( ) const
inline

Return whether element itself should be visible. Elements can be also hidden due to the parent being not visible, use IsVisibleEffective() to check.

◆ IsVisibleEffective()

bool Urho3D::UIElement::IsVisibleEffective ( ) const

Return whether element is effectively visible (parent element chain is visible).

◆ RegisterObject()

void Urho3D::UIElement::RegisterObject ( Context context)
static

Register object factory.

◆ SetBringToBack()

void Urho3D::UIElement::SetBringToBack ( bool  enable)

Set whether should be put to background when another element is focused.

◆ SetBringToFront()

void Urho3D::UIElement::SetBringToFront ( bool  enable)

Set whether should be brought to front when focused.

◆ SetClipBorder()

void Urho3D::UIElement::SetClipBorder ( const IntRect rect)

Set child element clipping border.

◆ SetClipChildren()

void Urho3D::UIElement::SetClipChildren ( bool  enable)

Set whether should clip child elements. Default false.

◆ SetColor() [1/2]

void Urho3D::UIElement::SetColor ( const Color color)

Set color on all corners.

◆ SetColor() [2/2]

void Urho3D::UIElement::SetColor ( Corner  corner,
const Color color 
)

Set color on one corner.

◆ SetDefaultStyle()

void Urho3D::UIElement::SetDefaultStyle ( XMLFile style)

Set default style file for later use by children elements.

◆ SetDragDropMode()

void Urho3D::UIElement::SetDragDropMode ( DragAndDropModeFlags  mode)

Set drag and drop flags.

◆ SetEditable()

void Urho3D::UIElement::SetEditable ( bool  enable)

Set whether value is editable through input. Not applicable to all elements. Default true.

◆ SetElementEventSender()

void Urho3D::UIElement::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.

◆ SetEnableAnchor()

void Urho3D::UIElement::SetEnableAnchor ( bool  enable)

Enable automatic positioning & sizing of the element relative to its parent using min/max anchor and min/max offset. Default false.

◆ SetEnabled()

void Urho3D::UIElement::SetEnabled ( bool  enable)

Set whether reacts to input. Default false, but is enabled by subclasses if applicable.

◆ SetFocus()

void Urho3D::UIElement::SetFocus ( bool  enable)

Set whether is focused. Only one element can be focused at a time.

◆ SetFocusMode()

void Urho3D::UIElement::SetFocusMode ( FocusMode  mode)

Set focus mode.

◆ SetHeight()

void Urho3D::UIElement::SetHeight ( int  height)

Set height only.

◆ SetHorizontalAlignment()

void Urho3D::UIElement::SetHorizontalAlignment ( HorizontalAlignment  align)

Set horizontal alignment.

◆ SetIndent()

void Urho3D::UIElement::SetIndent ( int  indent)

Set horizontal indentation.

◆ SetIndentSpacing()

void Urho3D::UIElement::SetIndentSpacing ( int  indentSpacing)

Set indent spacing (number of pixels per indentation level).

◆ SetInternal()

void Urho3D::UIElement::SetInternal ( bool  enable)

Mark as internally (programmatically) created. Used when an element composes itself out of child elements.

◆ SetLayoutBorder()

void Urho3D::UIElement::SetLayoutBorder ( const IntRect border)

Set layout border.

◆ SetLayoutFlexScale()

void Urho3D::UIElement::SetLayoutFlexScale ( const Vector2 scale)

Set layout flex scale.

◆ SetLayoutMode()

void Urho3D::UIElement::SetLayoutMode ( LayoutMode  mode)

Set layout mode only.

◆ SetLayoutSpacing()

void Urho3D::UIElement::SetLayoutSpacing ( int  spacing)

Set layout spacing.

◆ SetMaxAnchor()

void Urho3D::UIElement::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.

◆ SetMaxHeight()

void Urho3D::UIElement::SetMaxHeight ( int  height)

Set maximum height.

◆ SetMaxOffset()

void Urho3D::UIElement::SetMaxOffset ( const IntVector2 offset)

Set offset of element's bottom right from the maximum anchor in pixels. No effect when anchor is not enabled.

◆ SetMaxSize()

void Urho3D::UIElement::SetMaxSize ( const IntVector2 maxSize)

Set maximum size.

◆ SetMaxWidth()

void Urho3D::UIElement::SetMaxWidth ( int  width)

Set maximum width.

◆ SetMinAnchor()

void Urho3D::UIElement::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.

◆ SetMinHeight()

void Urho3D::UIElement::SetMinHeight ( int  height)

Set minimum height.

◆ SetMinOffset()

void Urho3D::UIElement::SetMinOffset ( const IntVector2 offset)

Set offset of element's top left from the minimum anchor in pixels. No effect when anchor is not enabled.

◆ SetMinSize()

void Urho3D::UIElement::SetMinSize ( const IntVector2 minSize)

Set minimum size.

◆ SetMinWidth()

void Urho3D::UIElement::SetMinWidth ( int  width)

Set minimum width.

◆ SetName()

void Urho3D::UIElement::SetName ( const ea::string &  name)

Set name.

◆ SetOpacity()

void Urho3D::UIElement::SetOpacity ( float  opacity)

Set opacity.

◆ SetPivot()

void Urho3D::UIElement::SetPivot ( const Vector2 pivot)

Set pivot relative to element's size (from 0 to 1, where 0.5 is center). Overrides horizontal & vertical alignment.

◆ SetPosition()

void Urho3D::UIElement::SetPosition ( const IntVector2 position)

Set position.

◆ SetPriority()

void Urho3D::UIElement::SetPriority ( int  priority)

Set priority.

◆ SetSelected()

void Urho3D::UIElement::SetSelected ( bool  enable)

Set selected mode. Actual meaning is element dependent, for example constant hover or pressed effect.

◆ SetSize()

void Urho3D::UIElement::SetSize ( const IntVector2 size)

Set size.

◆ SetSortChildren()

void Urho3D::UIElement::SetSortChildren ( bool  enable)

Set whether should sort child elements according to priority. Default true.

◆ SetTraversalMode()

void Urho3D::UIElement::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.

◆ SetUseDerivedOpacity()

void Urho3D::UIElement::SetUseDerivedOpacity ( bool  enable)

Set whether parent elements' opacity affects opacity. Default true.

◆ SetVerticalAlignment()

void Urho3D::UIElement::SetVerticalAlignment ( VerticalAlignment  align)

Set vertical alignment.

◆ SetVisible()

void Urho3D::UIElement::SetVisible ( bool  enable)

Set whether is visible. Visibility propagates to child elements.

◆ SetWidth()

void Urho3D::UIElement::SetWidth ( int  width)

Set width only.


The documentation for this class was generated from the following files: