Libraries.Interface.Item Documentation
The Item class represents any object that has a position (such as x and y coordinates) and dimensions (e.g. width and height). Note that because Item contains blueprint actions, it can't be used directly. Users should use classes that inherit from Item, such as Item2D, Item3D, Drawable, or Model.
Inherits from: Libraries.Language.Object
Variables Table
Variables | Description |
---|---|
integer LIST | |
integer CHART | |
integer CHECKBOX | |
integer TEXTBOX | |
integer RADIO_BUTTON | |
integer DIALOG | |
integer CHART_ITEM | |
integer PROGRESS_BAR | |
integer MENU_BAR | |
integer TOGGLE_BUTTON | |
integer CUSTOM | |
integer TABLE | |
integer GROUP | |
integer POPUP_MENU | |
integer MENU_ITEM | |
integer CHART_SECTION | |
integer ITEM | |
integer CELL | |
integer PANE | |
integer TREE_TABLE | |
integer BUTTON | |
integer NOT_ACCESSIBLE | The not accessible flag indicates that the accessibility system should ignore this item. Any item can override it, but it is the default to prevent flooding the system with a great deal of UI helper classes. |
integer TAB_PANE | |
integer LIST_ITEM | |
integer TOOLBAR | |
integer TREE_ITEM | |
integer TEXT_FIELD | |
integer TREE | |
integer TAB | |
integer TREE_TABLE_CELL | |
integer LABEL |
Actions Documentation
AddBehavior(Libraries.Interface.Behaviors.Behavior behavior)
AddFocusListener(Libraries.Interface.Events.FocusListener listener)
This action adds a FocusListener to the Item. When the Item receives a FocusEvent due to either gaining or losing the focus, the listener will be notified.
Parameters
Example
use Libraries.Interface.Item
use Libraries.Interface.Events.FocusListener
Item myItem
FocusListener listener
myItem:AddFocusListener(listener)
AddGestureListener(Libraries.Interface.Events.GestureListener listener)
This action adds a GestureListener to the Item. If the Item ever receives a GestureEvent, the listener will be notified.
Parameters
Example
use Libraries.Interface.Item
use Libraries.Interface.Events.GestureListener
Item myItem
GestureListener listener
myItem:AddGestureListener(listener)
AddMouseListener(Libraries.Interface.Events.MouseListener listener)
This action adds a MouseListener to the Item. If the Item ever receives a MouseEvent due to a mouse click, the mouse listener will be notified.
Parameters
Example
use Libraries.Interface.Item
use Libraries.Interface.Events.MouseListener
Item myItem
MouseListener listener
myItem:AddMouseListener(listener)
AddMouseMovementListener(Libraries.Interface.Events.MouseMovementListener listener)
This action adds a MouseMovementListener to the Item. If the Item ever receives a MouseEvent due to mouse movement, the listener will be notified.
Parameters
Example
use Libraries.Interface.Item
use Libraries.Interface.Events.MouseMovementListener
Item myItem
MouseMovementListener listener
myItem:AddMouseMovementListener(listener)
AddMouseWheelListener(Libraries.Interface.Events.MouseWheelListener listener)
This action adds a MouseWheelListener to the Item. If the Item ever receives a MouseEvent due to the mouse wheel being scrolled, the listener will be notified.
Parameters
Example
use Libraries.Interface.Item
use Libraries.Interface.Events.MouseWheelListener
Item myItem
MouseWheelListener listener
myItem:AddMouseWheelListener(listener)
AddTouchListener(Libraries.Interface.Events.TouchListener listener)
This action adds a TouchListener to the Item. If the Item ever receives a TouchEvent, the listener will be notified.
Parameters
Example
use Libraries.Interface.Item
use Libraries.Interface.Events.TouchListener
Item myItem
TouchListener listener
myItem:AddTouchListener(listener)
BeginCollision(Libraries.Interface.Item item)
This action is used to indicate that two items have just begun colliding. When two Items collide, the BeginCollision action should be called on both of them, with the other item passed as a parameter to the action. Note that this action does nothing by default, but classes that inherit from Item may override it.
Parameters
- Libraries.Interface.Item: The other Item involved in the collision.
Example
use Libraries.Interface.Item
Item collider1
Item collider2
collider1:BeginCollision(collider2)
collider2:BeginCollision(collider1)
CancelBehaviors()
This action stops all behaviors this Item is following without finishing them.
Compare(Libraries.Language.Object object)
This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.
Parameters
- Libraries.Language.Object: The object to compare to.
Return
integer: The Compare result, Smaller, Equal, or Larger.
Example
Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)
Dispose()
This action is used to free up any additional memory that is being used by this Item for purposes such as graphics. Note that the Item class doesn't have any extra memory that needs to be released with this action, but some classes which inherit from Item, such as Libraries.Game.Graphics.Drawable, do.
DisposeAll()
This action is used to call Dispose on this Item and on the entire children hierarchy of this Item.
DisposeChildren()
This action is used to call Dispose on the entire children hierarchy of this Item. This will not call Dispose on this Item.
Empty()
This action will remove all Items from this Item's children hierarchy. Note that this will not empty the hierarchies of the contained Items.
Example
use Libraries.Interface.Item
Item parentItem
Item child1
Item child2
Item grandchild
parentItem:Add(child1)
parentItem:Add(child2)
child1:Add(grandChild)
parentItem:Empty()
EmptyAll()
This action will call Empty on the entire children hierarchy of this item, and then empty this item as well.
EmptyChildren()
This action is used to call Empty on all children contained in this item's children hierarchy. This will not empty the children of this item.
Equals(Libraries.Language.Object object)
This action determines if two objects are equal based on their hash code values.
Parameters
- Libraries.Language.Object: The to be compared.
Return
boolean: True if the hash codes are equal and false if they are not equal.
Example
use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)
FinishCollision(Libraries.Interface.Item item)
This action is used to indicate that two items that were previously colliding no longer are. The FinishCollision action should be called on both Items involved, with the other item passed as a parameter to the action. Note that this action does nothing by default, but classes that inherit from Item may override it.
Parameters
- Libraries.Interface.Item: The other Item involved in the collision.
Example
use Libraries.Interface.Item
Item collider1
Item collider2
collider1:FinishCollision(collider2)
collider2:FinishCollision(collider1)
Focus()
This action sets focus on this Item. If the Item is not focusable, it will instead look through the parent hierarchy and set focus on the first focusable ancestor. If no focusable Item can be found, this action will have no effect.
GainedFocus(Libraries.Interface.Events.FocusEvent event)
GetAccessibilityCode()
This action returns the current accessiblity code for this Item
Return
integer:
GetAccessibilityRoleDescription()
This action returns the custom accessibility role description for this item, if any.
Return
text:
GetAccessibilityType()
This action returns the name of the accessiblity code for this Item as Text
Return
text:
GetAccessibleParent()
This action returns the nearest parent object that is accessible. This can be anything that the programmer wants to be accessible, from user interface components in a 2D interface to 3D components relative in 3-space on screen. By default, items have no accessible parent and are self-contained, but user interface components normally override the behavior so that controls can be logically nested within each other. attribute: returns Item
Return
GetChildAsItem(integer index)
This action is used to retrieve the children of this Item as Items. This makes it possible to retrieve or iterate over the children without having to perform casting.
Parameters
- integer index: The index of the child to retrieve from the child array.
Return
Libraries.Interface.Item: The child item at the given index.
Example
use Libraries.Interface.Item
Item parentItem
Item child1
child1:SetName("First")
parentItem:Add(child1)
Item child2
child2:SetName("Second")
parentItem:Add(child2)
Item child3
child3:SetName("Third")
parentItem:Add(child3)
integer counter = 0
repeat while counter < item:GetItemCount()
Item child = parentItem:GetChildAsItem(counter)
output child:GetName()
counter = counter + 1
end
GetDescription()
This action returns the current internal description of the Item.
Return
text:
Example
use Libraries.Interface.Item
Item item
item:SetDescription("Used for demo purposes.")
output "My item's description is : " + item:GetDescription()
GetFocusListeners()
This action returns an Iterator containing all of the FocusListeners that have been added to this Item using the AddFocusListener action.
Return
Libraries.Containers.Iterator: An iterator containing all of the registered FocusListeners.
GetGestureListeners()
This action returns an Iterator containing all of the GestureListeners that have been added to this Item using the AddGestureListener action.
Return
Libraries.Containers.Iterator: An iterator containing all of the registered GestureListeners.
GetGlobalX()
This action returns the Item's global x coordinate. This is the actual world coordinate that the item exists at after it has been offset by its parent's position. If this Item doesn't have a parent, and the offset hasn't been set manually, this is the same as GetX().
Return
number:
Example
use Libraries.Interface.Item2D
Item2D myItem
myItem:SetOffsetX(100)
myItem:SetX(30)
number globalX = myItem:GetGlobalX()
GetGlobalY()
This action returns the Item's global y coordinate. This is the actual world coordinate that the item exists at after it has been offset by its parent's position. If this Item doesn't have a parent, and the offset hasn't been set manually, this is the same as GetY().
Return
number:
Example
use Libraries.Interface.Item2D
Item2D myItem
myItem:SetOffsetY(60)
myItem:SetX(90)
number globalY = myItem:GetGlobalY()
GetGlobalZ()
This action returns the Item's global z coordinate. This is the actual world coordinate that the item exists at after it has been offset by its parent's position. If this Item doesn't have a parent, and the offset hasn't been set manually, this is the same as GetZ().
Return
number:
Example
use Libraries.Interface.Item3D
Item3D myItem
myItem:SetOffsetZ(40)
myItem:SetX(50)
number globalZ = myItem:GetGlobalZ()
GetHashCode()
This action gets the hash code for an object.
Return
integer: The integer hash code of the object.
Example
Object o
integer hash = o:GetHashCode()
GetInputGroup()
This action returns the input group for this Item. When used with the Game libraries, this tag describes what InputTable (if any) can interact with this Item due to input.
Return
text: The input group tag being used by this Item.
Example
use Libraries.Interface.Item
Item item
item:SetInputGroup("arrowKeys")
output "My item's input group is : " + item:GetInputGroup()
GetInputTable()
Return
GetItemCount()
This action will return the total number of children this Item has.
Return
integer: The number of children items this Item has.
Example
use Libraries.Interface.Item
Item parentItem
Item child1
child1:SetName("First")
parentItem:Add(child1)
Item child2
child2:SetName("Second")
parentItem:Add(child2)
Item child3
child3:SetName("Third")
parentItem:Add(child3)
integer counter = 0
repeat while counter < item:GetItemCount()
Item child = parentItem:GetChildAsItem(counter)
output child:GetName()
counter = counter + 1
end
GetMouseListeners()
This action returns an Iterator containing all of the MouseListeners that have been added to this Item using the AddMouseListener action.
Return
Libraries.Containers.Iterator: An iterator containing all of the registered MouseListeners.
GetMouseMovementListeners()
This action returns an Iterator containing all of the MouseMovementListeners that have been added to this Item using the AddMouseMovementListener action.
Return
Libraries.Containers.Iterator: An iterator containing all of the registered MouseMovementListeners.
GetMouseWheelListeners()
This action returns an Iterator containing all of the MouseWheelListeners that have been added to this Item using the AddMouseWheelListener action.
Return
Libraries.Containers.Iterator: An iterator containing all of the registered MouseWheelListeners.
GetName()
This action returns the current internal name of the Item.
Return
text:
Example
use Libraries.Interface.Item
Item item
item:SetName("My Item")
output "My item's name is " + item:GetName()
GetNextFocus()
This action returns the next focus item. When this Item has the focus and the user requests the focus to advance (e.g. by pressing the tab key), the returned value is the next item to receive that focus, if it is defined. If it isn't defined, the focus can not advance from this Item.
Return
Libraries.Interface.Item: The next Item to receive focus after this one.
GetPreviousFocus()
This action returns the previous focus item. When this Item has the focus and the user requests the focus to move backwards (e.g. by pressing shift & tab), the returned value is the previous item to receive that focus, if it is defined. If it isn't defined, the focus can not move backwards from this Item.
Return
Libraries.Interface.Item: The previous Item to receive focus before this one.
GetPropertiesSize()
Return
integer
GetProperty(text key)
GetPropertyKeyIterator()
GetTouchListeners()
This action returns an Iterator containing all of the TouchListeners that have been added to this Item using the AddTouchListener action.
Return
Libraries.Containers.Iterator: An iterator containing all of the registered TouchListeners.
GetX()
This action returns the currently set X coordinate of the Item.
Return
number:
Example
use Libraries.Interface.Item2D
Item2D myItem
number value = myItem:GetX()
GetY()
This action returns the currently set Y coordinate of the Item.
Return
number:
Example
use Libraries.Interface.Item2D
Item2D myItem
number value = myItem:GetY()
GetZ()
This action returns the currently set Z coordinate of the Item.
Return
number:
Example
use Libraries.Interface.Item3D
Item3D myItem
number value = myItem:GetZ()
HasProperties()
Return
boolean
HasProperty(text key)
Parameters
- text key
Return
boolean
Hide()
This action is used to indicate that an Item and all Items that were added to it should not be visible on the screen. Note that the Item class on its own cannot be drawn on the screen, but classes that inherit from it such as Libraries.Game.Graphics.Drawable can be. By default, Items are considered visible.
Example
use Libraries.Interface.Item
Item item
item:Hide()
IsAcceptingMouseInput()
This action returns whether or not this Item accepts mouse input. If the value is true, this will intercept incoming mouse events, triggering any related MouseListeners and InputSets and preventing the mouse event from propagating to other Items on the Layer. The default value is true.
Return
boolean: True if this Item can receive mouse events, or false otherwise.
IsAccessibleParent()
This action returns the nearest parent object that is accessible. This can be anything that the programmer wants to be accessible, from user interface components in a 2D interface to 3D components relative in 3-space on screen. By default, items have no accessible parent and are self-contained, but user interface components normally override the behavior so that controls can be logically nested within each other. attribute: returns Item
Return
boolean:
IsFocusable()
This action returns whether or not the Item can currently receive focus. This property can be set with SetFocusable().
Return
boolean:
IsFocused()
The IsFocused action determines if this Item is currently focused, returning true if it is, or false if it is not.
Return
boolean:
IsOnLayer()
This action returns true if the item has been added to a Layer, or false otherwise.
Return
boolean: True if the item is on a Layer, or false otherwise.
IsShowing()
This action returns whether the Item is currently set to be visible on the screen.
Return
boolean: A boolean representing whether or not the Item is currently visible.
Example
use Libraries.Interface.Item
Item item
item:Hide()
boolean visible = item:IsShowing()
LostFocus(Libraries.Interface.Events.FocusEvent event)
MoveX(number xAmount)
This action will increase the x-coordinate of this Item by the given amount.
Parameters
- number xAmount
Example
use Libraries.Interface.Item
Item myItem
myItem:SetX(50)
myItem:MoveX(25)
MoveY(number yAmount)
This action will increase the y-coordinate of this Item by the given amount.
Parameters
- number yAmount
Example
use Libraries.Interface.Item2D
Item2D myItem
myItem:SetY(50)
myItem:MoveY(25)
MoveZ(number zAmount)
This action will increase the z-coordinate of this Item by the given amount.
Parameters
- number zAmount
Example
use Libraries.Interface.Item3D
Item3D myItem
myItem:SetZ(50)
myItem:MoveZ(25)
ProcessGestureEvent(Libraries.Interface.Events.GestureEvent event)
This action takes a gesture event and handles it. It will first test to see if the gesture event took place within the bounds of this Item. If so, it will notify any GestureListeners of the event. If the event was not contained within this Item, or if there are no GestureListeners on this Item, the Item will ask its parent Item to process the event, if there is a parent.
Parameters
Example
use Libraries.Interface.Item2D
use Libraries.Interface.Events.GestureEvent
use Libraries.Interface.Events.GestureListener
Item2D myItem
GestureListener listener
myItem:AddGestureListener(listener)
GestureEvent event
event:eventType = event:DOUBLE_TAP
myItem:ProcessGestureEvent(event)
ProcessMouseEvent(Libraries.Interface.Events.MouseEvent event)
This action takes a mouse event and handles it. It will first test to see if the mouse event took place within the bounds of this Item. If so, it will notify any MouseListeners of the event. If the event was not contained within this Item, or if there are no MouseListeners on this Item, the Item will ask its parent Item to process the mouse event, if there is a parent.
Parameters
Example
use Libraries.Interface.Item2D
use Libraries.Interface.Events.MouseEvent
use Libraries.Interface.Events.MouseListener
Item2D myItem
MouseListener listener
myItem:AddMouseListener(listener)
MouseEvent event
event:eventType = event:CLICKED_MOUSE
myItem:ProcessMouseEvent(event)
ProcessTouchEvent(Libraries.Interface.Events.TouchEvent event)
This action takes a touch event and handles it. It will first test to see if the touch event took place within the bounds of this Item. If so, it will notify any TouchListeners of the event. If the event was not contained within this Item, or if there are no TouchListeners on this Item, the Item will ask its parent Item to process the touch event, if there is a parent.
Parameters
Example
use Libraries.Interface.Item2D
use Libraries.Interface.Events.TouchEvent
use Libraries.Interface.Events.TouchListener
Item2D myItem
TouchListener listener
myItem:AddTouchListener(listener)
TouchEvent event
event:eventType = event:BEGAN
myItem:ProcessTouchEvent(event)
RemoveFocusListener(Libraries.Interface.Events.FocusListener listener)
This action removes a FocusListener from the Item. The listener will no longer receive notification if the Item gets a FocusEvent.
Parameters
Example
use Libraries.Interface.Item
use Libraries.Interface.Events.FocusListener
Item myItem
FocusListener listener
myItem:AddFocusListener(listener)
myItem:RemoveFocusListener(listener)
RemoveGestureListener(Libraries.Interface.Events.GestureListener listener)
This action removes a GestureListener from the Item. The listener will no longer receive notification if the Item gets a GestureEvent.
Parameters
Example
use Libraries.Interface.Item
use Libraries.Interface.Events.GestureListener
Item myItem
GestureListener listener
myItem:AddGestureListener(listener)
myItem:RemoveGestureListener(listener)
RemoveMouseListener(Libraries.Interface.Events.MouseListener listener)
This action removes a MouseListener from the Item. The listener will no longer receive notification if the Item gets a mouse click event.
Parameters
Example
use Libraries.Interface.Item
use Libraries.Interface.Events.MouseListener
Item myItem
MouseListener listener
myItem:AddMouseListener(listener)
myItem:RemoveMouseListener(listener)
RemoveMouseMovementListener(Libraries.Interface.Events.MouseMovementListener listener)
This action removes a MouseMovementListener from the Item. The listener will no longer receive notification if the Item gets a mouse movement event.
Parameters
Example
use Libraries.Interface.Item
use Libraries.Interface.Events.MouseMovementListener
Item myItem
MouseMovementListener listener
myItem:AddMouseMovementListener(listener)
myItem:RemoveMouseMovementListener(listener)
RemoveMouseWheelListener(Libraries.Interface.Events.MouseWheelListener listener)
This action removes a MouseWheelListener from the Item. The listener will no longer receive notification if the Item gets a mouse wheel event.
Parameters
Example
use Libraries.Interface.Item
use Libraries.Interface.Events.MouseWheelListener
Item myItem
MouseWheelListener listener
myItem:AddMouseWheelListener(listener)
myItem:RemoveMouseWheelListener(listener)
RemoveTouchListener(Libraries.Interface.Events.TouchListener listener)
This action removes a TouchListener from the Item. The listener will no longer receive notification if the Item gets a TouchEvent.
Parameters
Example
use Libraries.Interface.Item
use Libraries.Interface.Events.TouchListener
Item myItem
TouchListener listener
myItem:AddTouchListener(listener)
myItem:RemoveTouchListener(listener)
SetAcceptsMouseInput(boolean accepts)
This action sets whether or not this Item accepts mouse input. If set to true, this will intercept incoming mouse events, triggering any related MouseListeners and InputSets and preventing the mouse event from propagating to other Items on the Layer. The default value is true.
Parameters
- boolean accepts: True to set this Item to receive mouse events, or false to ignore them.
SetAccessibilityCode(integer newAccessibilityCode)
This action changes the accessibility code for this Item. This should be done with care because setting the accessiblity code to the incorrect type can cause accessibility to stop functioning or, in some cases, cause the program to crash.
Parameters
- integer newAccessibilityCode: the new accessibility code for this Item.
SetAccessibilityRoleDescription(text newRoleDescription)
This action sets a custom accessibility role description for this item. This should only be done if there is not a standard accessibility code for the type of item being implemented. If the item behaves very similarly to a standard control type, then set the accessibility code to that standard type while also setting the role description. For example, if implementing an item that extends Control, is keyboard focusable, and responds to activation via both mouse clicks and the Space key, like a button, but it shouldn't be described as a button, then set the accessibility code to BUTTON and the custom role description to whatever is appropriate. If there isn't a suitable accessibility code, or if in doubt, set the accessibility code to CUSTOM.
Parameters
- text newRoleDescription: the new custom role description for this Item.
SetDescription(text newDescription)
This action sets the internal description of the Item.
Parameters
- text newDescription
Example
use Libraries.Interface.Item
Item item
item:SetDescription("Used for demo purposes.")
SetFocusable(boolean focus)
The SetFocusable action sets whether or not this Item should be focusable. If the Item is currently focused and made unfocusable, then it will lose focus, and there will be no focused element.
Parameters
- boolean focus
SetInputGroup(text group)
This action sets the input group for this Item. When used with the Game libraries, this tag describes what InputTable (if any) can interact with this Item due to input.
Parameters
- text group: The new input group to use.
Example
use Libraries.Interface.Item
Item item
item:SetInputGroup("arrowKeys")
output "My item's input group is : " + item:GetInputGroup()
SetName(text newName)
This action sets the internal name of the Item.
Parameters
- text newName
Example
use Libraries.Interface.Item
Item item
item:SetName("My Item")
SetNextFocus(Libraries.Interface.Item next)
This action sets the next focus item. When this Item has the focus and the user requests the focus to advance (e.g. by pressing the tab key), the focus will move to the next focus item, if it is defined.
Parameters
- Libraries.Interface.Item: The next Item to receive focus after this one.
SetPosition(number newX, number newY, number newZ)
This action will set both the X, Y, and Z coordinates of the Item, in that order.
Parameters
- number newX
- number newY
- number newZ
Example
use Libraries.Interface.Item3D
Item3D myItem
myItem:SetPosition(30, 70, 45)
SetPreviousFocus(Libraries.Interface.Item previous)
This action sets the previous focus item. When this Item has the focus and the user requests the focus to move backwards (e.g. by pressing shift & tab), the focus will move to the previous focus item, if it is defined.
Parameters
- Libraries.Interface.Item: The previous Item to receive focus before this one.
SetProperty(text key, Libraries.Data.Formats.JavaScriptObjectNotation value)
Parameters
SetX(number setX)
This action sets the X coordinate of the Item.
Parameters
- number setX
Example
use Libraries.Interface.Item2D
Item2D myItem
myItem:SetX(35.0)
SetY(number setY)
This action sets the Y coordinate of the Item.
Parameters
- number setY
Example
use Libraries.Interface.Item2D
Item2D myItem
myItem:SetY(210.0)
SetZ(number setZ)
This action sets the Z coordinate of the Item.
Parameters
- number setZ
Example
use Libraries.Interface.Item3D
Item3D myItem
myItem:SetZ(180.0)
Show()
This action is used to indicate that an Item and all Items that were added to it should be visible on the screen. Note that the Item class on its own cannot be drawn on the screen, but classes that inherit from it such as Libraries.Game.Graphics.Drawable can be. By default, Items are considered visible.
Example
use Libraries.Interface.Item
Item item
item:Show()
Update(number secondsSinceUpdate)
This action updates the item. It takes a number parameter that should indicate how many seconds have passed since the last time this action was called. This action does nothing in the Item class, but any class that inherits from Item may override it.
Parameters
- number secondsSinceUpdate: The number of seconds that have passed since the last time Update was called.
Example
use Libraries.Interface.Item
use Libraries.System.DateTime
class Main is Item
action Main
// We'll use a DateTime object to count seconds.
DateTime time
number currentTime = time:GetEpochTime()
number newTime = 0
repeat while GetX() < 300
// Check what the time is now.
newTime = time:GetEpochTime()
// Calculate how many seconds have passed, then call Update.
Update( (newTime - currentTime)/1000 )
// Store the old time.
currentTime = newTime
end
end
// Our update action will move our Item to the right at 200 units a second.
action Update(number secondsSinceUpdate)
SetX(GetX() + 200 * secondsSinceUpdate)
end
end
UpdateAll(number secondsSinceUpdate)
This action calls the Update action on this Item and all Items that have been added to this item with the Add action.
Parameters
- number secondsSinceUpdate: The number of seconds that have passed since the last time Update was called.
Example
use Libraries.Interface.Item
Item parentItem
Item child1
Item child2
parentItem:Add(child1)
parentItem:Add(child2)
parentItem:UpdateAll(0)
On this page
Variables TableAction Documentation- AddBehavior(Libraries.Interface.Behaviors.Behavior behavior)
- AddFocusListener(Libraries.Interface.Events.FocusListener listener)
- AddGestureListener(Libraries.Interface.Events.GestureListener listener)
- AddMouseListener(Libraries.Interface.Events.MouseListener listener)
- AddMouseMovementListener(Libraries.Interface.Events.MouseMovementListener listener)
- AddMouseWheelListener(Libraries.Interface.Events.MouseWheelListener listener)
- AddTouchListener(Libraries.Interface.Events.TouchListener listener)
- BeginCollision(Libraries.Interface.Item item)
- CancelBehaviors()
- Compare(Libraries.Language.Object object)
- Dispose()
- DisposeAll()
- DisposeChildren()
- Empty()
- EmptyAll()
- EmptyChildren()
- Equals(Libraries.Language.Object object)
- FinishCollision(Libraries.Interface.Item item)
- Focus()
- GainedFocus(Libraries.Interface.Events.FocusEvent event)
- GetAccessibilityCode()
- GetAccessibilityRoleDescription()
- GetAccessibilityType()
- GetAccessibleParent()
- GetChildAsItem(integer index)
- GetDescription()
- GetFocusListeners()
- GetGestureListeners()
- GetGlobalX()
- GetGlobalY()
- GetGlobalZ()
- GetHashCode()
- GetInputGroup()
- GetInputTable()
- GetItemCount()
- GetMouseListeners()
- GetMouseMovementListeners()
- GetMouseWheelListeners()
- GetName()
- GetNextFocus()
- GetPreviousFocus()
- GetPropertiesSize()
- GetProperty(text key)
- GetPropertyKeyIterator()
- GetTouchListeners()
- GetX()
- GetY()
- GetZ()
- HasProperties()
- HasProperty(text key)
- Hide()
- IsAcceptingMouseInput()
- IsAccessibleParent()
- IsFocusable()
- IsFocused()
- IsOnLayer()
- IsShowing()
- LostFocus(Libraries.Interface.Events.FocusEvent event)
- MoveX(number xAmount)
- MoveY(number yAmount)
- MoveZ(number zAmount)
- ProcessGestureEvent(Libraries.Interface.Events.GestureEvent event)
- ProcessMouseEvent(Libraries.Interface.Events.MouseEvent event)
- ProcessTouchEvent(Libraries.Interface.Events.TouchEvent event)
- RemoveFocusListener(Libraries.Interface.Events.FocusListener listener)
- RemoveGestureListener(Libraries.Interface.Events.GestureListener listener)
- RemoveMouseListener(Libraries.Interface.Events.MouseListener listener)
- RemoveMouseMovementListener(Libraries.Interface.Events.MouseMovementListener listener)
- RemoveMouseWheelListener(Libraries.Interface.Events.MouseWheelListener listener)
- RemoveTouchListener(Libraries.Interface.Events.TouchListener listener)
- SetAcceptsMouseInput(boolean accepts)
- SetAccessibilityCode(integer newAccessibilityCode)
- SetAccessibilityRoleDescription(text newRoleDescription)
- SetDescription(text newDescription)
- SetFocusable(boolean focus)
- SetInputGroup(text group)
- SetName(text newName)
- SetNextFocus(Libraries.Interface.Item next)
- SetPosition(number newX, number newY, number newZ)
- SetPreviousFocus(Libraries.Interface.Item previous)
- SetProperty(text key, Libraries.Data.Formats.JavaScriptObjectNotation value)
- SetX(number setX)
- SetY(number setY)
- SetZ(number setZ)
- Show()
- Update(number secondsSinceUpdate)
- UpdateAll(number secondsSinceUpdate)