Stock Element Functions
Updated 198 Days AgoPublic

Stock element functions with description

Below is a list of the important element functions that you may find useful. All functions are available for ANY control that extends from UIElement

UIElement

The root element of all controls. Basically everything should extend this.

Usage:

HudElem:addElement(Elem) -- All these functions use the self syntax ':'

Functions:

FunctionArgumentsDescriptionReturn values
addElement(UIElement: Element)Adds an element as a childNone
addElementBefore(UIElement: Element, UIElement: Before)Adds an element as a child, before the other elementNone
addElementAfter(UIElement: Element, UIElement: After)Adds an element as a child, after the other elementNone
canAddElement(UIElement: Element)Checks whether or not we can add this elementTrue, if we can, False if not
unsubscribeFromAllModelsNoneUnsubscribes from all model events attached to this elementNone
setModel(Object: Model)Sets the model for this elementNone
subscribeToGlobalModel(Object: Instance, String: Scope, String: Item, Function: Callback(Object: Model))Subscribes to a global model item with the given scopeNone
subscribeToModel(Object: Model, Function: Callback((Object: Model))Subscribes to the given modelNone
linkToElementModel(UIElement: Element, String: Item, Boolean: RequiresSubscription, Function: Callback(Object: Model))Subscribes to the model attached to the given elementNone
isClosedNoneChecks whether or not the element was closedTrue if closed, false if not
closeNoneCloses the elementNone
closeAndRefocus(UIElement: Element)Closes the element and moves focus to the otherNone
getSoundSetNoneGets the current soundset for this elementThe soundset name, if any
findSoundAlias(String: Name)Attempts to find the given alias in the current soundsetThe sound alias, if any
playSound(String: Name)Plays a sound on the element with the given alias nameNone
playActionSFXNonePlays the action sound (Same as playSound("action"))None
toggleMouseNoneToggles the mouse input on or offNone
setHandleMouse(Boolean: Enabled)Sets whether or not this element has mouse eventsNone
toggleHandleMouseNoneToggle whether or not this element has mouse eventsNone
setHandleMouseMoveNone(Boolean: Enabled) Sets whether or not this element has mouse move eventNone
toggleHandleMouseMoveNoneToggle whether or not this element has mouse move eventNone
setHandleMouseButtonNone(Boolean: Enabled) Sets whether or not this element has mouse click eventNone
toggleHandleMouseButtonNoneToggle whether or not this element has mouse click eventNone
clearMouseFocusNoneRemove focus to this control from the mouseNone
IsMouseInsideElement(UIElement: Element)Checks whether or not the mouse is over the elementTrue if over, False if not
setLeftRight(Boolean: isLeft, Boolean: isRight, Number: Left, Number: Right)See MarginsNone
setTopBottom(Boolean: isTop, Boolean: isBottom, Number: Top, Number: Bottom)See MarginsNone
setParent(UIElement: Element)Sets this elements parent to the elementNone
setActive(Boolean: BubbleToChildren)Sets this element state to activeNone
setInactive(Boolean: BubbleToChildren)Sets this element state to inactiveNone
processEvent(Table: EventObject)Sends an event to this elementNone
processEventToParent(Table: EventObject)Sends an event to this element that bubbles up to the parentNone
getRootNoneGets the root parent of this elementThe parent element, if any
dispatchEventToRoot(Table: EventObject)Sends an event to this elements root most parentNone
dispatchEventToParentWithSelf(Table: EventObject)Sends an event to this elements parent, with a reference to this elementNone
dispatchEventToParentWithElement(Table: EventObject, UIElement: Element)Sends an event to this elements parent, with a reference to the elementNone
dispatchEventToChildren(Table: EventObject)Sends an event to this elements childrenNone
registerEventHandler(String: EventName, Function: Handler)Subscribe to an event with the given nameNone
hideNoneHides the element from viewNone
showNoneShows the elementNone
rotateRandomlyNoneRotates the element on the X and Y axis randomlyNone
spinRandomlyNoneSpins the element on the Z axis randomlyNone
flickerNoneMakes the element flicker using alphaNone
playBitchinFX(Unknown1, Unknown2, Unknown3)We were as surprised as you are...None
playBitchinFXReverse(Unknown1, Unknown2, Unknown3)Opposite of playBitchinFX ...None
setClass(String: Name)Sets the class name of the elementNone
showDebugTimerNoneShows the debug timer clipNone

Examples:

  1. TODO: This will be linked to from an Examples column with source code examples below.
Last Author
DTZxPorter
Projects
None
Subscribers
None