|
| 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 (bool renderUICommand=false) |
| Render the UI. If renderUICommand is false (default), is assumed to be the default UI render to backbuffer called by Engine, and will be performed only once. Additional UI renders to a different rendertarget may be triggered from the renderpath.
|
|
void | DebugDraw (UIElement *element) |
| Debug draw a UI element.
|
|
SharedPtr< UIElement > | LoadLayout (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< UIElement > | LoadLayout (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 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.
|
|
UIElement * | GetRoot () const |
|
UIElement * | GetRootModalElement () const |
|
Cursor * | GetCursor () const |
|
IntVector2 | GetCursorPosition () const |
|
UIElement * | GetElementAt (const IntVector2 &position, bool enabledOnly=true) |
| Return UI element at global screen coordinates. By default returns only input-enabled elements.
|
|
UIElement * | GetElementAt (int x, int y, bool enabledOnly=true) |
| Return UI element at global screen coordinates. By default returns only input-enabled elements.
|
|
UIElement * | GetElementAt (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).
|
|
UIElement * | GetFocusElement () const |
|
UIElement * | GetFrontElement () const |
|
const Vector< UIElement * > | GetDragElements () |
| Return currently dragged elements.
|
|
unsigned | GetNumDragElements () const |
| Return the number of currently dragged elements.
|
|
UIElement * | GetDragElement (unsigned index) |
| Return the drag element at index.
|
|
const 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 |
|
const IntVector2 & | GetCustomSize () const |
|
void | SetElementRenderTexture (UIElement *element, Texture2D *texture) |
| Set texture to which element will be rendered.
|
|
| Object (Context *context) |
| Construct.
|
|
| ~Object () override |
| Destruct. Clean up self from event sender & receiver structures.
|
|
virtual StringHash | GetType () const =0 |
|
virtual const String & | GetTypeName () const =0 |
|
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 PODVector< 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 |
|
const VariantMap & | GetGlobalVars () const |
|
void | SetGlobalVar (StringHash key, const Variant &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 |
|
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 |
|
int | WeakRefs () const |
|
RefCount * | RefCountPtr () |
| Return pointer to the reference count structure.
|
|
|
| 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 PODVector< float > &vertexData) |
| Upload UI geometry into a vertex buffer.
|
|
void | Render (VertexBuffer *buffer, const PODVector< UIBatch > &batches, unsigned batchStart, unsigned batchEnd) |
| Render UI batches to the current rendertarget. Geometry must have been uploaded first.
|
|
void | GetBatches (PODVector< UIBatch > &batches, PODVector< float > &vertexData, UIElement *element, IntRect currentScissor) |
| Generate batches from an UI element recursively. Skip the cursor element.
|
|
UIElement * | GetElementAt (const IntVector2 &position, bool enabledOnly, IntVector2 *elementScreenPosition) |
| Return UI element at global screen coordinates. Return position converted to element's screen coordinates.
|
|
void | GetElementAt (UIElement *&result, UIElement *current, const IntVector2 &position, bool enabledOnly) |
| Return UI element at screen position recursively.
|
|
UIElement * | GetFocusableElement (UIElement *element) |
| Return the first element in hierarchy that can alter focus.
|
|
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.
|
|
HashMap< WeakPtr< UIElement >, DragData * >::Iterator | DragElementErase (HashMap< 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.
|
|
UI subsystem. Manages the graphical user interface.