Rebel Fork Framework
Urho3D::UI Class Reference

UI subsystem. Manages the graphical user interface. More...

#include <Urho3D/UI/UI.h>

Inheritance diagram for Urho3D::UI:
Urho3D::Object Urho3D::RefCounted

Classes

struct  DragData
 Data structure used to represent the drag data associated to a UIElement. More...
 

Public Member Functions

 UI (Context *context)
 Construct.
 
 ~UI () override
 Destruct.
 
void SetCursor (Cursor *cursor)
 
void SetFocusElement (UIElement *element, bool byKey=false)
 Set focused UI element.
 
bool SetModalElement (UIElement *modalElement, bool enable)
 
void Clear ()
 Clear the UI (excluding the cursor).
 
void Update (float timeStep)
 Update the UI logic. Called by HandlePostUpdate().
 
void RenderUpdate ()
 Update the UI for rendering. Called by HandleRenderUpdate().
 
void Render ()
 Render the UI batches. Returns true if call rendered anything. Rendering succeeds only once per frame.
 
void DebugDraw (UIElement *element)
 Debug draw a UI element.
 
SharedPtr< UIElementLoadLayout (Deserializer &source, XMLFile *styleFile=nullptr)
 Load a UI layout from an XML file. Optionally specify another XML file for element style. Return the root element.
 
SharedPtr< UIElementLoadLayout (XMLFile *file, XMLFile *styleFile=nullptr)
 Load a UI layout from an XML file. Optionally specify another XML file for element style. Return the root element.
 
bool SaveLayout (Serializer &dest, UIElement *element)
 Save a UI layout to an XML file. Return true if successful.
 
void SetClipboardText (const ea::string &text)
 
void SetDoubleClickInterval (float interval)
 
void SetMaxDoubleClickDistance (float distPixels)
 
void SetDragBeginInterval (float interval)
 
void SetDragBeginDistance (int pixels)
 
void SetDefaultToolTipDelay (float delay)
 
void SetMaxFontTextureSize (int size)
 
void SetNonFocusedMouseWheel (bool nonFocusedMouseWheel)
 
void SetUseSystemClipboard (bool enable)
 
void SetUseScreenKeyboard (bool enable)
 
void SetUseMutableGlyphs (bool enable)
 
void SetForceAutoHint (bool enable)
 
void SetFontHintLevel (FontHintLevel level)
 
void SetFontSubpixelThreshold (float threshold)
 
void SetFontOversampling (int oversampling)
 
void SetScale (float scale)
 
void SetWidth (float width)
 Scale UI to the specified width in pixels.
 
void SetHeight (float height)
 Scale UI to the specified height in pixels.
 
void SetCustomSize (const IntVector2 &size)
 
void SetCustomSize (int width, int height)
 Set custom size of the root element.
 
UIElementGetRoot () const
 
void SetRoot (UIElement *root)
 Sets new root UI element.
 
UIElementGetRootModalElement () const
 
void SetRootModalElement (UIElement *rootModal)
 Sets new root UI element for modals.
 
CursorGetCursor () const
 
IntVector2 GetUICursorPosition () const
 
IntVector2 GetSystemCursorPosition () const
 
UIElementGetElementAt (const IntVector2 &position, bool enabledOnly=true)
 
UIElementGetElementAt (int x, int y, bool enabledOnly=true)
 Return UI element at global screen coordinates. By default returns only input-enabled elements.
 
UIElementGetElementAt (UIElement *root, const IntVector2 &position, bool enabledOnly=true)
 Get a child element at element's screen position relative to specified root element.
 
IntVector2 ConvertSystemToUI (const IntVector2 &systemPos) const
 Convert system mouse position (or offset) to scaled UI position (or offset).
 
IntVector2 ConvertUIToSystem (const IntVector2 &uiPos) const
 Convert scaled UI position (or offset) to system mouse position (or offset).
 
UIElementGetFocusElement () const
 
UIElementGetFrontElement () const
 
const ea::vector< UIElement * > & GetDragElements ()
 Return currently dragged elements.
 
unsigned GetNumDragElements () const
 Return the number of currently dragged elements.
 
UIElementGetDragElement (unsigned index)
 Return the drag element at index.
 
const ea::string & GetClipboardText () const
 
float GetDoubleClickInterval () const
 
float GetMaxDoubleClickDistance () const
 
float GetDragBeginInterval () const
 
int GetDragBeginDistance () const
 
float GetDefaultToolTipDelay () const
 
int GetMaxFontTextureSize () const
 
bool IsNonFocusedMouseWheel () const
 
bool GetUseSystemClipboard () const
 
bool GetUseScreenKeyboard () const
 
bool GetUseMutableGlyphs () const
 
bool GetForceAutoHint () const
 
FontHintLevel GetFontHintLevel () const
 
float GetFontSubpixelThreshold () const
 
int GetFontOversampling () const
 
bool HasModalElement () const
 Return true when UI has modal element(s).
 
bool IsDragging () const
 Return whether a drag is in progress.
 
float GetScale () const
 
IntVector2 GetSize () const
 
const IntVector2GetCustomSize () const
 
void SetRenderTarget (Texture2D *texture, Color clearColor=Color::TRANSPARENT_BLACK)
 Set texture to which entire UI will be rendered.
 
Texture2DGetRenderTarget () const
 Returns texture to which this UI is rendered.
 
bool IsRendered () const
 Returns true if thus UI is already rendered in this frame.
 
- 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.
 
virtual void SerializeInBlock (Archive &archive)
 Serialize content from/to archive. May throw ArchiveException.
 
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.
 

Private Member Functions

 URHO3D_OBJECT (UI, Object)
 
void Initialize ()
 Initialize when screen mode initially set.
 
void Update (float timeStep, UIElement *element)
 Update UI element logic recursively.
 
void SetVertexData (VertexBuffer *dest, const ea::vector< float > &vertexData)
 Upload UI geometry into a vertex buffer.
 
void Render (VertexBuffer *buffer, const ea::vector< UIBatch > &batches, unsigned batchStart, unsigned batchEnd)
 Render UI batches to the current rendertarget. Geometry must have been uploaded first.
 
void GetBatches (ea::vector< UIBatch > &batches, ea::vector< float > &vertexData, UIElement *element, IntRect currentScissor)
 Generate batches from an UI element recursively. Skip the cursor element.
 
void GetElementAt (UIElement *&result, UIElement *current, const IntVector2 &position, bool enabledOnly)
 Return UI element at screen position recursively.
 
UIElementGetFocusableElement (UIElement *element)
 Return the first element in hierarchy that can alter focus.
 
UIElementGetWheelHandlerElement (UIElement *element)
 Return the first element in hierarchy that can handle wheel.
 
void GetCursorPositionAndVisible (IntVector2 &pos, bool &visible)
 Return cursor position and visibility either from the cursor element, or the Input subsystem.
 
void SetCursorShape (CursorShape shape)
 Set active cursor's shape.
 
void ReleaseFontFaces ()
 Force release of font faces when global font properties change.
 
void ProcessHover (const IntVector2 &windowCursorPos, MouseButtonFlags buttons, QualifierFlags qualifiers, Cursor *cursor)
 Handle button or touch hover.
 
void ProcessClickBegin (const IntVector2 &windowCursorPos, MouseButton button, MouseButtonFlags buttons, QualifierFlags qualifiers, Cursor *cursor, bool cursorVisible)
 Handle button or touch begin.
 
void ProcessClickEnd (const IntVector2 &windowCursorPos, MouseButton button, MouseButtonFlags buttons, QualifierFlags qualifiers, Cursor *cursor, bool cursorVisible)
 Handle button or touch end.
 
void ProcessMove (const IntVector2 &windowCursorPos, const IntVector2 &cursorDeltaPos, MouseButtonFlags buttons, QualifierFlags qualifiers, Cursor *cursor, bool cursorVisible)
 Handle mouse or touch move.
 
void SendDragOrHoverEvent (StringHash eventType, UIElement *element, const IntVector2 &screenPos, const IntVector2 &deltaPos, UI::DragData *dragData)
 Send a UI element drag or hover begin event.
 
void SendClickEvent (StringHash eventType, UIElement *beginElement, UIElement *endElement, const IntVector2 &pos, MouseButton button, MouseButtonFlags buttons, QualifierFlags qualifiers)
 Send a UI click event.
 
void SendDoubleClickEvent (UIElement *beginElement, UIElement *endElement, const IntVector2 &firstPos, const IntVector2 &secondPos, MouseButton button, MouseButtonFlags buttons, QualifierFlags qualifiers)
 Send a UI double click event.
 
void HandleScreenMode (StringHash eventType, VariantMap &eventData)
 Handle screen mode event.
 
void HandleMouseButtonDown (StringHash eventType, VariantMap &eventData)
 Handle mouse button down event.
 
void HandleMouseButtonUp (StringHash eventType, VariantMap &eventData)
 Handle mouse button up event.
 
void HandleMouseMove (StringHash eventType, VariantMap &eventData)
 Handle mouse move event.
 
void HandleMouseWheel (StringHash eventType, VariantMap &eventData)
 Handle mouse wheel event.
 
void HandleTouchBegin (StringHash eventType, VariantMap &eventData)
 Handle touch begin event.
 
void HandleTouchEnd (StringHash eventType, VariantMap &eventData)
 Handle touch end event.
 
void HandleTouchMove (StringHash eventType, VariantMap &eventData)
 Handle touch move event.
 
void HandleKeyDown (StringHash eventType, VariantMap &eventData)
 Handle keypress event.
 
void HandleTextInput (StringHash eventType, VariantMap &eventData)
 Handle text input event.
 
void HandleBeginFrame (StringHash eventType, VariantMap &eventData)
 Handle frame begin event.
 
void HandlePostUpdate (StringHash eventType, VariantMap &eventData)
 Handle logic post-update event.
 
void HandleRenderUpdate (StringHash eventType, VariantMap &eventData)
 Handle render update event.
 
void HandleDropFile (StringHash eventType, VariantMap &eventData)
 Handle a file being drag-dropped into the application window.
 
void HandleFocused (StringHash eventType, VariantMap &eventData)
 Handle off-screen UI subsystems gaining focus.
 
void HandleEndAllViewsRender (StringHash eventType, VariantMap &eventData)
 Handle rendering to a texture.
 
ea::unordered_map< WeakPtr< UIElement >, DragData * >::iterator DragElementErase (ea::unordered_map< WeakPtr< UIElement >, DragData * >::iterator i)
 Remove drag data and return next iterator.
 
void ProcessDragCancel ()
 Handle clean up on a drag cancel.
 
IntVector2 SumTouchPositions (UI::DragData *dragData, const IntVector2 &oldSendPos)
 Sum touch positions and return the begin position ready to send.
 
void ResizeRootElement ()
 Resize root element to effective size.
 
IntVector2 GetEffectiveRootElementSize (bool applyScale=true) const
 Return effective size of the root element, according to UI scale and resolution / custom size.
 
bool IsHandlingInput () const
 Return true when subsystem should not process any mouse/keyboard input.
 
MaterialGetBatchMaterial (const UIBatch &batch) const
 Return material corresponding to UIBatch.
 

Private Attributes

WeakPtr< Graphicsgraphics_
 Graphics subsystem.
 
WeakPtr< Rendererrenderer_
 Renderer subsystem.
 
SharedPtr< UIElementrootElement_
 UI root element.
 
SharedPtr< UIElementrootModalElement_
 UI root modal element.
 
SharedPtr< Cursorcursor_
 Cursor.
 
WeakPtr< UIElementfocusElement_
 Currently focused element.
 
SharedPtr< DefaultUIBatchStateCachebatchStateCache_
 Cached pipeline states.
 
ea::vector< UIBatchbatches_
 UI rendering batches.
 
ea::vector< float > vertexData_
 UI rendering vertex data.
 
ea::vector< UIBatchdebugDrawBatches_
 UI rendering batches for debug draw.
 
ea::vector< float > debugVertexData_
 UI rendering vertex data for debug draw.
 
SharedPtr< VertexBuffervertexBuffer_
 UI vertex buffer.
 
SharedPtr< VertexBufferdebugVertexBuffer_
 UI debug geometry vertex buffer.
 
ea::vector< UIElement * > tempElements_
 UI element query vector.
 
ea::string clipBoard_
 Clipboard text.
 
float doubleClickInterval_
 Seconds between clicks to register a double click.
 
float dragBeginInterval_
 Seconds from mouse button down to begin a drag if there has been no movement exceeding pixel threshold.
 
float defaultToolTipDelay_
 Tooltip default display delay in seconds.
 
int dragBeginDistance_
 Drag begin event distance threshold in pixels.
 
MouseButtonFlags mouseButtons_
 Mouse buttons held down.
 
MouseButtonFlags lastMouseButtons_
 Last mouse button pressed.
 
QualifierFlags qualifiers_
 Qualifier keys held down.
 
int maxFontTextureSize_
 Font texture maximum size.
 
bool initialized_
 Initialized flag.
 
bool usingTouchInput_
 Touch used flag.
 
bool nonFocusedMouseWheel_
 Flag to switch mouse wheel event to be sent to non-focused element at cursor.
 
bool useSystemClipboard_
 Flag for using operating system clipboard instead of internal.
 
bool useScreenKeyboard_
 Flag for showing the on-screen keyboard on focusing a LineEdit.
 
bool useMutableGlyphs_
 Flag for using mutable (erasable) font glyphs.
 
bool forceAutoHint_
 Flag for forcing FreeType auto hinting.
 
FontHintLevel fontHintLevel_
 FreeType hinting level (default is FONT_HINT_LEVEL_NORMAL).
 
float fontSubpixelThreshold_
 Maxmimum font size for subpixel glyph positioning and oversampling (default is 12).
 
int fontOversampling_
 Horizontal oversampling for subpixel fonts (default is 2).
 
bool uiRendered_
 Flag for UI already being rendered this frame.
 
unsigned nonModalBatchSize_
 Non-modal batch size (used internally for rendering).
 
Timer clickTimer_
 Timer used to trigger double click.
 
WeakPtr< UIElementdoubleClickElement_
 UI element last clicked for tracking double clicks.
 
IntVector2 doubleClickFirstPos_
 Screen position of first mouse click for double click distance checking.
 
float maxDoubleClickDist_
 Max screen distance the first click in a double click can be from the second click in a double click.
 
ea::unordered_map< WeakPtr< UIElement >, bool > hoveredElements_
 Currently hovered elements.
 
ea::unordered_map< WeakPtr< UIElement >, DragData * > dragElements_
 Currently dragged elements.
 
int dragElementsCount_
 Number of elements in dragElements_.
 
int dragConfirmedCount_
 Number of elements in dragElements_ with dragPending = false.
 
ea::unordered_map< WeakPtr< UIElement >, MouseButtonFlags > touchDragElements_
 UI elements that are being touched with touch input.
 
ea::vector< UIElement * > dragElementsConfirmed_
 Confirmed drag elements cache.
 
float uiScale_
 Current scale of UI.
 
IntVector2 customSize_
 Root element custom size. 0,0 for automatic resizing (default).
 
WeakPtr< Texture2Dtexture_
 Texture that UI will be rendered into.
 
Color clearColor_ = Color::TRANSPARENT_BLACK
 Color which will be used to clear target texture.
 
SharedPtr< MaterialnoTextureMaterial_
 
SharedPtr< MaterialalphaMapMaterial_
 
SharedPtr< MaterialdiffMapMaterial_
 
SharedPtr< MaterialdiffMapAlphaMaskMaterial_
 

Additional Inherited Members

- Static Public Member Functions inherited from Urho3D::Object
static const TypeInfoGetTypeInfoStatic ()
 Return type info static.
 
- Static Public Attributes inherited from Urho3D::Object
static constexpr ea::array< StringHash, 0 > TypeHierarchy {}
 
- Protected Attributes inherited from Urho3D::Object
WeakPtr< Contextcontext_
 Execution context.
 

Detailed Description

UI subsystem. Manages the graphical user interface.

Member Function Documentation

◆ GetClipboardText()

const ea::string & Urho3D::UI::GetClipboardText ( ) const

Return clipboard text.

◆ GetCursor()

Cursor* Urho3D::UI::GetCursor ( ) const
inline

Return cursor.

◆ GetCustomSize()

const IntVector2& Urho3D::UI::GetCustomSize ( ) const
inline

Return root element custom size. Returns 0,0 when custom size is not being used and automatic resizing according to window size is in use instead (default).

◆ GetDefaultToolTipDelay()

float Urho3D::UI::GetDefaultToolTipDelay ( ) const
inline

Return tooltip default display delay in seconds.

◆ GetDoubleClickInterval()

float Urho3D::UI::GetDoubleClickInterval ( ) const
inline

Return UI element double click interval in seconds.

◆ GetDragBeginDistance()

int Urho3D::UI::GetDragBeginDistance ( ) const
inline

Return UI drag start event distance threshold in pixels.

◆ GetDragBeginInterval()

float Urho3D::UI::GetDragBeginInterval ( ) const
inline

Return UI drag start event interval in seconds.

◆ GetElementAt()

UIElement * Urho3D::UI::GetElementAt ( const IntVector2 position,
bool  enabledOnly = true 
)

Return mouse position. Return UI element at global screen coordinates. By default returns only input-enabled elements.

◆ GetFocusElement()

UIElement* Urho3D::UI::GetFocusElement ( ) const
inline

Return focused element.

◆ GetFontHintLevel()

FontHintLevel Urho3D::UI::GetFontHintLevel ( ) const
inline

Return the current FreeType font hinting level.

◆ GetFontOversampling()

int Urho3D::UI::GetFontOversampling ( ) const
inline

Get the oversampling (horizonal stretching) used to improve subpixel font rendering. Only affects fonts smaller than the subpixel limit.

◆ GetFontSubpixelThreshold()

float Urho3D::UI::GetFontSubpixelThreshold ( ) const
inline

Get the font subpixel threshold. Below this size, if the hint level is LIGHT or NONE, fonts will use subpixel positioning plus oversampling for higher-quality rendering. Has no effect at hint level NORMAL.

◆ GetForceAutoHint()

bool Urho3D::UI::GetForceAutoHint ( ) const
inline

Return whether is using forced autohinting.

◆ GetFrontElement()

UIElement * Urho3D::UI::GetFrontElement ( ) const

Return topmost enabled root-level non-modal element.

◆ GetMaxDoubleClickDistance()

float Urho3D::UI::GetMaxDoubleClickDistance ( ) const
inline

Get max screen distance in pixels for double clicks to register.

◆ GetMaxFontTextureSize()

int Urho3D::UI::GetMaxFontTextureSize ( ) const
inline

Return font texture maximum size.

◆ GetRoot()

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

Return root UI element.

◆ GetRootModalElement()

UIElement* Urho3D::UI::GetRootModalElement ( ) const
inline

Return root modal element.

◆ GetScale()

float Urho3D::UI::GetScale ( ) const
inline

Return current UI scale.

◆ GetSize()

IntVector2 Urho3D::UI::GetSize ( ) const

Return screen size adjusted by scale.

◆ GetUICursorPosition()

IntVector2 Urho3D::UI::GetUICursorPosition ( ) const

Return cursor position.

◆ GetUseMutableGlyphs()

bool Urho3D::UI::GetUseMutableGlyphs ( ) const
inline

Return whether is using mutable (eraseable) glyphs for fonts.

◆ GetUseScreenKeyboard()

bool Urho3D::UI::GetUseScreenKeyboard ( ) const
inline

Return whether focusing a LineEdit will show the on-screen keyboard.

◆ GetUseSystemClipboard()

bool Urho3D::UI::GetUseSystemClipboard ( ) const
inline

Return whether is using the system clipboard.

◆ IsNonFocusedMouseWheel()

bool Urho3D::UI::IsNonFocusedMouseWheel ( ) const
inline

Return whether mouse wheel can control also a non-focused element.

◆ SetClipboardText()

void Urho3D::UI::SetClipboardText ( const ea::string &  text)

Set clipboard text.

◆ SetCursor()

void Urho3D::UI::SetCursor ( Cursor cursor)

Set cursor UI element.

◆ SetCustomSize()

void Urho3D::UI::SetCustomSize ( const IntVector2 size)

Set custom size of the root element. This disables automatic resizing of the root element according to window size. Set custom size 0,0 to return to automatic resizing.

◆ SetDefaultToolTipDelay()

void Urho3D::UI::SetDefaultToolTipDelay ( float  delay)

Set tooltip default display delay in seconds.

◆ SetDoubleClickInterval()

void Urho3D::UI::SetDoubleClickInterval ( float  interval)

Set UI element double click interval in seconds.

◆ SetDragBeginDistance()

void Urho3D::UI::SetDragBeginDistance ( int  pixels)

Set UI drag event start distance threshold in pixels.

◆ SetDragBeginInterval()

void Urho3D::UI::SetDragBeginInterval ( float  interval)

Set UI drag event start interval in seconds.

◆ SetFontHintLevel()

void Urho3D::UI::SetFontHintLevel ( FontHintLevel  level)

Set the hinting level used by FreeType fonts.

◆ SetFontOversampling()

void Urho3D::UI::SetFontOversampling ( int  oversampling)

Set the oversampling (horizonal stretching) used to improve subpixel font rendering. Only affects fonts smaller than the subpixel limit.

◆ SetFontSubpixelThreshold()

void Urho3D::UI::SetFontSubpixelThreshold ( float  threshold)

Set the font subpixel threshold. Below this size, if the hint level is LIGHT or NONE, fonts will use subpixel positioning plus oversampling for higher-quality rendering. Has no effect at hint level NORMAL.

◆ SetForceAutoHint()

void Urho3D::UI::SetForceAutoHint ( bool  enable)

Set whether to force font autohinting instead of using FreeType's TTF bytecode interpreter.

◆ SetMaxDoubleClickDistance()

void Urho3D::UI::SetMaxDoubleClickDistance ( float  distPixels)

Set max screen distance in pixels between double click clicks.

◆ SetMaxFontTextureSize()

void Urho3D::UI::SetMaxFontTextureSize ( int  size)

Set maximum font face texture size. Must be a power of two. Default is 2048.

◆ SetModalElement()

bool Urho3D::UI::SetModalElement ( UIElement modalElement,
bool  enable 
)

Set modal element. Until all the modal elements are dismissed, all the inputs and events are only sent to them. Return true when successful. Only the modal element can clear its modal status or when it is being destructed.

◆ SetNonFocusedMouseWheel()

void Urho3D::UI::SetNonFocusedMouseWheel ( bool  nonFocusedMouseWheel)

Set whether mouse wheel can control also a non-focused element.

◆ SetScale()

void Urho3D::UI::SetScale ( float  scale)

Set UI scale. 1.0 is default (pixel perfect). Resize the root element to match.

◆ SetUseMutableGlyphs()

void Urho3D::UI::SetUseMutableGlyphs ( bool  enable)

Set whether to use mutable (eraseable) glyphs to ensure a font face never expands to more than one texture. Default false.

◆ SetUseScreenKeyboard()

void Urho3D::UI::SetUseScreenKeyboard ( bool  enable)

Set whether to show the on-screen keyboard (if supported) when a LineEdit is focused. Default true on mobile devices.

◆ SetUseSystemClipboard()

void Urho3D::UI::SetUseSystemClipboard ( bool  enable)

Set whether to use system clipboard. Default false.

Member Data Documentation

◆ noTextureMaterial_

SharedPtr<Material> Urho3D::UI::noTextureMaterial_
private

Default materials


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