Libraries.Interface.Controls.Tab Documentation

Inherits from: Libraries.Interface.Controls.Button, Libraries.Interface.Controls.Control, Libraries.Interface.Item, Libraries.Interface.Item2D, Libraries.Language.Object, Libraries.Interface.Events.TextureLoadListener

Actions Documentation

Activate(Libraries.Interface.Events.BehaviorEvent event)

undefined, the relatedItem is focused instead, if possible.

Parameters

Activate()

This action returns a default behavior for this paricular control. Some controls do nothing by default, like a TextBox that responds to different kinds of input. Others, however, have default behaviors, like a Button or a MenuItem. If there is no default behavior, this action returns undefined.

Add(integer index, Libraries.Interface.Item2D newItem)

This action adds a different Item2D into this one, storing the added Item2D at a specific index in the internal array.

Parameters

Example

use Libraries.Interface.Item2D

Item2D parentItem
Item2D child
parentItem:Add(0, child)

Add(Libraries.Interface.Item2D newItem)

This action adds a different Item2D into this one. This makes a few things happen. 1. The added item will get this item as its parent. 2. The added item's x and y coordinates will become relative to this Item. 3. Most actions on this Item will also affect the added Item.

Parameters

Example

use Libraries.Interface.Item2D

Item2D parentItem
Item2D child
parentItem:Add(child)

AddBehavior(Libraries.Interface.Behaviors.Behavior behavior)

This action adds a new Behavior to this Item.

Parameters

AddControlActivationListener(Libraries.Interface.Events.ControlActivationListener listener)

This action removes an Item2D at a specifed index from the internal array.

Parameters

Example

use Libraries.Interface.Item2D

Item2D parentItem
Item2D child
parentItem:Add(0, child)
parentItem:Remove(0)

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)

AddLayoutProperties(Libraries.Interface.Layouts.LayoutProperties properties)

Returns true if rendering the mouse down event.

Parameters

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)

AddSelectionListener(Libraries.Interface.Events.SelectionListener listener)

This action adds the given SelectionListeners to the Control.

Parameters

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)

Advance(number time)

This action is used to advance the item forward in time in physics space to synchronize it for time of impact solving. This action is used internally and users should not need to use this action. Attribute Parameter time The amount of seconds to advance the item forward in time

Parameters

  • number time

ApplyAngularImpulse(number impulse)

This action applies an angular impulse to this item. The units are in kilogram units squared per second. This modifies the angular velocity of this item. Physics must be enabled on this item before using this action.

Parameters

  • number impulse: The angular impulse in kilogram units squared per second

Example

use Libraries.Interface.Item2D

Item2D item
item:SetWidth(100)
item:SetHeight(100)
item:EnablePhysics(true)
item:ApplyAngularImpulse(80)

ApplyForce(Libraries.Compute.Vector2 force, Libraries.Compute.Vector2 point)

This action applies a force to this item at the passed point. The force is in kilogram units per second per second. The point is the screen coordinates where the point will be applied. If the point is not on the center of the item, then a torque will be introduced causing the item to rotate. Physics must be enabled on this item before using this action.

Parameters

Example

use Libraries.Compute.Vector2
use Libraries.Interface.Item2D

Item2D item
Vector2 force
Vector2 point

item:SetWidth(100)
item:SetHeight(100)
item:EnablePhysics(true)

force:Set(300, 350)
point:Set(100, 100)    // apply the force to the top right corner of the item

item:ApplyForce(force, point)

ApplyForceToCenter(Libraries.Compute.Vector2 force)

This action applies a force to this item at the center of the item. The force is in kilogram units per second per second. No torque is introduced to the item when using this action. Physics must be enabled on this item before using this action.

Parameters

Example

use Libraries.Compute.Vector2
use Libraries.Interface.Item2D

Item2D item
Vector2 force

item:SetWidth(100)
item:SetHeight(100)
item:EnablePhysics(true)

force:Set(300, 350)

item:ApplyForce(force)

ApplyLinearImpulse(Libraries.Compute.Vector2 impulse, Libraries.Compute.Vector2 point)

This action applies a linear impulse to this item at the passed point. The impulse is in kilogram units per second. This immeadietly modifies the linear velocity of this item. The point is the screen coordinates where the impulse will be applied. If the point is not the center of the item, then the angular velocity of this item will also be modified. Physics must be enabled on this item before using this action.

Parameters

Example

use Libraries.Interface.Item2D
use Libraries.Compute.Vector2

Item2D item
Vector2 impulse
Vector2 point

item:SetWidth(100)
item:SetHeight(100)
item:EnablePhysics(true)

impulse:Set(100)
point:Set(100, 100)     // apply the impulse to the top right corner

item:ApplyLinearImpulse(impulse, point)

ApplyTorque(number torque)

This action applies a torque to this item. The units are kilogram units squared per second per second. Physics must be enabled on this item before using this action.

Parameters

  • number torque: The torque to apply to this item in kilogram units squared per second per second

Example

use Libraries.Interface.Item2D

Item2D item
item:SetWidth(100)
item:SetHeight(100)
item:EnablePhysics(true)
item:ApplyTorque(350)

AreChildrenProcessingMouseEvents()

This action returns whether or not this Item is allowing its children to receive mouse events if the Item is custom drawing. If the Item isn't using custom drawing, this value is irrelevant -- children objects always receive mouse events before the parent if the parent isn't performing custom drawing.

Return

boolean:

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

Example

use Libraries.Interface.Item

Item collider1
Item collider2
collider1:BeginCollision(collider2)
collider2:BeginCollision(collider1)

BeginMouseOver()

This action is used when a control is moused over by the mouse.

CanRotate(boolean flag)

This action gets the position of the center of this item in global (world) coordinates.

Parameters

  • boolean flag

CancelBehaviors()

This action stops all behaviors this Item is following without finishing them.

ClickedMouse()

This action is used when a control is clicked by the mouse.

CollideWithChildren()

This action sets the mass, mass moment of inertia, and how the 2D item should move (via linear velocity) to be at the desired location.

Return

boolean:

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

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)

ComputeDistance(Libraries.Compute.Vector2 point, integer childIndex, Libraries.Compute.Vector2 normalOut)

This action computes the distance of the passed point from the collision shape attached to this item. This action is used internally and users should not need to use this action.

Parameters

  • Libraries.Compute.Vector2: The vector representing the point to compute the distance from
  • integer childIndex: The index of the collision shape attached to this item we want the bounding box of
  • Libraries.Compute.Vector2: The direction of the point from the shape

Return

number: The distance of the point from the collision shape of this item

Contains(number containsX, number containsY)

This action tests if a point in global x,y coordinates is contained inside this Item2D. The global coordinates are considered to be the x and y coordinates of this Item plus its offsetX and offsetY values.

Parameters

  • number containsX
  • number containsY

Return

boolean: Whether or not the point is contained in this Item.

Example

use Libraries.Interface.Item2D

Item2D item
item:SetPosition(50, 50)
item:SetWidth(100)
item:SetHeight(50)
boolean value = item:Contains(125, 70)

CopyAndActivateInputTable(text name)

This action obtains the Input Table from this control, copies it, assigns it a group name, sets the control to use the new input table, and then adds it to the global input table hash table.

Parameters

  • text name: the name of the group for the new input table.

Return

Libraries.Game.InputTable: the input table copy

Example

use Libraries.Game.Game
use Libraries.Interface.Controls.TextBox
use Libraries.Game.InputTable

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        TextBox box
        InputTable copy = box:CopyAndActivateInputTable("New Group")
    end

    action Update(number seconds)
    end
end

CreateNodes(Libraries.Game.Collision.BroadphaseCollision2D broadphase, Libraries.Game.Collision.PhysicsPosition2D transform)

This action creates the nodes for this item for the broadphase collision. This action is needed in order to add the item to the collision detection system. This action is used internally and users should not need to use this action.

Parameters

DestroyNodes(Libraries.Game.Collision.BroadphaseCollision2D broadphase)

This action destroys the nodes for this item for the broadphase collision, essentially removing it from the collision detection system. This action is used internally and users should not need to use this action.

Parameters

DisplayCloseButton(boolean display)

Parameters

  • boolean display

DisplayName(boolean display)

Parameters

  • boolean display

Dispose()

The OnClose action is called when this Tab is closed (or in other words, when the Tab is removed from a TabPane or TabBar). By default, this action does nothing, but classes inheriting from Tab can override this action to perform clean up before closing the Tab.

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.

Draw(Libraries.Game.Graphics.Painter2D painter)

The Draw action is used to perform custom drawing on this Item and its children. This is only called during the Game engine's draw phase if this Item has enabled custom drawing via the SetCustomDrawing action. This is an advanced feature, and shouldn't be used by most users. If custom drawing is enabled, this action should be overriden -- if it isn't, the Item will attempt to provide default rendering for itself, its view, and its children, without regard to depth buffering. This action is responsible for instructing the provided Painter on how to draw this item, the view, and its children, and in what order to do so.

Parameters

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.Item2D

Item2D parentItem
Item2D child1
Item2D child2
Item2D 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.

EmptySelectionListeners()

This action empties or removes all SelectionListeners which have been added to the Control of the given SelectionEvent.

EnablePhysics(boolean flag)

This action enables physics for this item. Passing true turns on physics for this item while passing false turns off physics for this item.

Parameters

  • boolean flag: Whether or not to enable physics for this item

Example

use Libraries.Game.Graphics.Drawable

Drawable circle
circle:LoadFilledCircle(30)
circle:EnablePhysics(true)

EndMouseOver()

This action is used when a control is moused over and it ends.

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Parameters

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)

FastMoving(boolean flag)

This action gets the linear velocity of this item in units per second. Physics must be enabled on this item before using this action.

Parameters

  • boolean flag

Example

use Libraries.Interface.Item2D
use Libraries.Compute.Vector2

Item2D item
Vector2 velocity

item:SetWidth(100)
item:SetHeight(100)
item:EnablePhysics(true)
velocity:Set(100, 0)
item:SetLinearVelocity(velocity)

Vector2 currentVelocity = item:GetLinearVelocity()

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

Example

use Libraries.Interface.Item

Item collider1
Item collider2
collider1:FinishCollision(collider2)
collider2:FinishCollision(collider1)

FlipX()

This action will flip the Item2D across the X-axis. This flip is represented by the internal vertices of the Item2D. For classes that inherit from Item and can draw on the screen, this will flip the drawn image on the screen.

Example

use Libraries.Interface.Item2D

Item2D myItem
myItem:FlipX()

FlipY()

This action will flip the Item2D across the Y-axis. This flip is represented by the internal vertices of the Item2D. For classes that inherit from Item and can draw on the screen, this will flip the drawn image on the screen.

Example

use Libraries.Interface.Item2D

Item2D myItem
myItem:FlipY()

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)

This action is fired if the item received the focus.

Parameters

GainedSelection()

This action is used when a control gains the selection.

GetAccentColor()

This action gets the accent color from the control.

Return

Libraries.Game.Graphics.ColorGroup: the accent control.

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 parent of this Item2D. An Item2D gets a parent when it is added to another Item using the Add action.

Return

Libraries.Interface.Item:

Example

use Libraries.Interface.Item2D

Item2D parentItem
Item2D child
parentItem:Add(child)
Item2D item = child:GetParent()

GetActivationBehavior()

This action gets the behavior for the control.

Return

Libraries.Interface.Behaviors.Behavior: behavior the event behavior to attatch to the control.

GetAngularDamping()

This action gets the inverse inertia of this item (i.e., one divided by the inertia of this item). Physics must be enabled on this item before using this action.

Return

number: The inverse inertia of this item

Example

use Libraries.Interface.Item2D

Item2D item
item:SetWidth(100)
item:SetHeight(100)
item:EnablePhysics(true)
item:SetMass(20)
number inverseInertia = item:GetInverseInertia()

GetAngularVelocity()

This action gets this item's angular velocity in radians per second. Physics must be enabled in this item before using this action.

Return

number: The angular velocity of this item in radians per second

Example

use Libraries.Interface.Item2D

Item2D item
item:SetWidth(100)
item:SetHeight(100)
item:EnablePhysics(true)
item:SetAngularVelocity(0.1)
number angularVelocity = item:GetAngularVelocity()

GetBackgroundColor()

This action gets the color of the Control background color.

Return

Libraries.Game.Graphics.ColorGroup: the background the color.

GetBorderColor()

This action gets the border color of the control.

Return

Libraries.Game.Graphics.ColorGroup: the controls border color.

GetBorderStyle()

This action gets the border style either, LayoutProperties.TOP, LayoutProperties.BOTTOM, LayoutProperties.LEFT, LayoutProperties.RIGHT, and LayoutProperties.ALL.

Return

integer:

GetBorderThickness()

This action gets the border thickness on the control.

Return

number: the border thickness.

GetBottomLeftPixelRounding()

This action returns the bottom left pixel rounding value.

Return

number: the bottom left pixel rounding value.

GetBottomLeftRounding()

This action returns the bottom left rounding value.

Return

number: the bottom left rounding value.

GetBottomMargin()

This action gets the bottom margin size. The bottom margin is the space outside of the bottom border.

Return

number: the number amount of bottom margin.

GetBottomPadding()

This action gets the bottom padding size. The bottom padding is the space inside of the bottom border.

Return

number: the number amount of bottom padding.

GetBottomRightPixelRounding()

This action returns the bottom right pixel rounding value.

Return

number: the bottom right pixel rounding value.

GetBottomRightRounding()

This action returns the bottom right rounding value.

Return

number: the bottom right rounding value.

GetBoundingBox(integer childIndex)

This action is used to get the bounding box of the item. A bounding box is an axis-alligned rectangle containing the shape used for broadphase collision. This action is used internally and users should not need to use this action.

Parameters

  • integer childIndex: The index of the collision shape attached to this item we want the bounding box of

Return

Libraries.Game.Collision.BoundingBox2D: The bounding box of the collision shape attached to this item

GetBoundingRectangle()

This action returns a rectangle that fully encloses the four corners of the Item as it is represented by its internal vertices array. Note that the rectangle produced by this action will be larger than the actual box formed by this Item's vertices if the Item is rotated.

Return

Libraries.Game.Shapes.Rectangle:

Example

use Libraries.Interface.Item2D
use Libraries.Game.Shapes.Rectangle

Item2D myItem
myItem:SetBoundingBox(20, 80, 100, 100)
Rectangle box = myItem:GetBoundingRectangle()

GetCenterX()

This action returns the x coordinate of the center of this Item2D.

Return

number:

Example

use Libraries.Interface.Item2D
Item2D myItem
myItem:SetWidth(20)
myItem:SetX(100)
number x = myItem:GetCenterX()

GetCenterY()

This action returns the y coordinate of the center of this Item2D.

Return

number:

Example

use Libraries.Interface.Item2D
Item2D myItem
myItem:SetHeight(20)
myItem:SetY(100)
number y = myItem:GetCenterY()

GetChildren()

This action gets the children of this item in an array.

Return

Libraries.Containers.Array: The children of this item in an array

Example

use Libraries.Interface.Item2D

Item2D parent
Item2D child1
Item2D child2

parent:Add(child1)
parent:Add(child2)

Array<Item2D> children = parent:GetChildren()

GetClipCoordinates(Libraries.Compute.Vector2 xCoords, Libraries.Compute.Vector2 yCoords)

This action gets the clipping coordinates of this Item2D. The coordinates are returned via the two provided Vector2 parameters, the first vector storing the x values of the left and right sides of the clipping coordinates and the second vector storing the y values of the bottom and top sides. The returned boolean value indicates if this Item uses these clipping coordinates (i.e. if this Item or one of its parent Items has clipping enabled). If the clipping is valid, the action returns true. Otherwise, it returns false.

Parameters

Return

boolean:

GetCollisionGroupFlag()

This action gets the total force on this item. The units are kilogram units per second per second. Physics must be enabled on this item before using this action.

Return

boolean: The total force in kilogram units per second per second

Example

use Libraries.Interface.Item2D
use Libraries.Compute.Vector2

Item2D item
Vector2 force

item:SetWidth(100)
item:SetHeight(100)
item:EnablePhysics(true)
force:Set(300, 350)
item:SetForce(force)
Vector2 totalForce = item:GetForce()

GetCollisionGroupIndex()

This action gets this item's angular velocity in radians per second. Physics must be enabled in this item before using this action.

Return

integer: The angular velocity of this item in radians per second

Example

use Libraries.Interface.Item2D

Item2D item
item:SetWidth(100)
item:SetHeight(100)
item:EnablePhysics(true)
item:SetAngularVelocity(0.1)
number angularVelocity = item:GetAngularVelocity()

GetCollisionList()

This is an action used internally to retrieve the head of the linked list of collisions with this item. This action is used internally and users should not need to use this action.

Return

Libraries.Game.Collision.CollisionEdge2D: The head of the doubly linked list of collisions

GetColorProperty(text property)

This action gets the color of a given property in the Control.

Parameters

  • text property

Return

Libraries.Game.Graphics.ColorGroup:

GetContainerGridHeight()

This action returns how many rows this Control should be divided into when using a GridLayout. This will have no effect if this Control is not a container or if it is using a different layout.

Return

integer:

GetContainerGridWidth()

This action returns how many columns this Control should be divided into when using a GridLayout. This will have no effect if this Control is not a container or if it is using a different layout.

Return

integer:

GetCurrentLayoutProperties()

This action returns the LayoutProperties that were last used to define the Control, and thus describe its current state. Note that if the Control hasn't been laid out yet, this will return undefined.

Return

Libraries.Interface.Layouts.LayoutProperties: The last LayoutProperties used to layout this Control, or undefined if it hasn't been laid out yet.

GetDefaultFont()

This action obtains the default font for this control. This allows individual controls to customize their default font properties on a per control basis. By default, the system asks for the default system font name on a per control basis, then loads that font and returns it. Font loading is shared, so loading many fonts of the same type and size is not particularly expensive and can be done without much concern for memory requirements.

Return

Libraries.Game.Graphics.Font:

Example

use Libraries.Interface.Controls.TextBox
use Libraries.Game.Graphics.Font

TextBox box
text name = box:GetDefaultFont()
output name

GetDefaultFontName()

Return

text

GetDefaultFontSize()

Return

integer

GetDefaultLayoutProperties()

This action returns the default LayoutProperties used for this Control.

Return

Libraries.Interface.Layouts.LayoutProperties: The default LayoutProperties of this Control.

GetDensity()

This action applies a linear impulse to this item at the passed point. The impulse is in kilogram units per second. This immeadietly modifies the linear velocity of this item. The point is the screen coordinates where the impulse will be applied. If the point is not the center of the item, then the angular velocity of this item will also be modified. Physics must be enabled on this item before using this action.

Return

number:

Example

use Libraries.Interface.Item2D
use Libraries.Compute.Vector2

Item2D item
Vector2 impulse
Vector2 point

item:SetWidth(100)
item:SetHeight(100)
item:EnablePhysics(true)

impulse:Set(100)
point:Set(100, 100)     // apply the impulse to the top right corner

item:ApplyLinearImpulse(impulse, point)

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()

GetDrawableShape()

This action returns the DrawableShape attached to this Item, if it has one. For a default Item2D, this action will return undefined, but Drawables will have an associated shape if they've been loaded. Attributes: Returns The DrawableShape attached to this Item, or undefined if there isn't one.

Return

Libraries.Game.Graphics.DrawableShape:

GetFocusBorderColor()

This action gets the focus border color.

Return

Libraries.Game.Graphics.ColorGroup: the focus border color.

GetFocusColor()

This action sets the focus color.

Return

Libraries.Game.Graphics.ColorGroup: the focus color.

GetFocusFontColor()

This action gets focus font color.

Return

Libraries.Game.Graphics.ColorGroup: the focus font color.

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.

GetFocusTarget()

The Item that is displayed in the TabPane when the Tab is activated.

Return

Libraries.Interface.Item2D:

GetFont()

This action returns the Font being used by this Control. How this Font is used varies between Controls, and in some cases the Control will ignore it entirely (for example, ScrollPanes), but typically this sets the font that's used for the default label on many Controls, such as Buttons. If the Font is undefined, many Controls will omit their default label.

Return

Libraries.Game.Graphics.Font: The Font being used for this Control.

GetFontColor()

This action gets the current the font color of the font contained in the Control.

Return

Libraries.Game.Graphics.ColorGroup:

GetFontOutlineColor()

This action gets the font outline color value.

Return

Libraries.Game.Graphics.ColorGroup: the font outline color value.

GetFontOutlineThickness()

This action returns the font outline thickness value.

Return

number: the font outline thickness value.

GetFontSize()

This action returns the base Font size to be used by this Control, if the Control uses a Font.

Return

integer:

GetForce()

This action gets the total force on this item. The units are kilogram units per second per second. Physics must be enabled on this item before using this action.

Return

Libraries.Compute.Vector2: The total force in kilogram units per second per second

Example

use Libraries.Interface.Item2D
use Libraries.Compute.Vector2

Item2D item
Vector2 force

item:SetWidth(100)
item:SetHeight(100)
item:EnablePhysics(true)
force:Set(300, 350)
item:SetForce(force)
Vector2 totalForce = item:GetForce()

GetForegroundColor()

This action gets the color of the Control foreground color.

Return

Libraries.Game.Graphics.ColorGroup: the foreground color.

GetForegroundSelectionColor()

This action gets the color of the Control foreground selection color.

Return

Libraries.Game.Graphics.ColorGroup: the foreground selection color.

GetFriction()

This action applies a force to this item at the center of the item. The force is in kilogram units per second per second. No torque is introduced to the item when using this action. Physics must be enabled on this item before using this action.

Return

number:

Example

use Libraries.Compute.Vector2
use Libraries.Interface.Item2D

Item2D item
Vector2 force

item:SetWidth(100)
item:SetHeight(100)
item:EnablePhysics(true)

force:Set(300, 350)

item:ApplyForce(force)

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 value. For an Item2D, this simply returns the Item2D's current z value.

Return

number:

GetGlowColor()

This action gets the glow color from the control.

Return

Libraries.Game.Graphics.ColorGroup: the glow color.

GetGridHeight()

The GetGridHeight action returns how many cells in a column this Control occupies. By default, this value is 1. This value is only used for GridLayouts, and is ignored by other layouts.

Return

integer:

GetGridWidth()

The GetGridWidth action returns how many cells in a row this Control occupies. By default, this value is 1. This value is only used for GridLayouts, and is ignored by other layouts.

Return

integer:

GetGridX()

This action returns this Control's cell x-coordinate within a GridLayout. This indicates which column this Control is located within. If the Control's parent container isn't using a GridLayout, this value is ignored.

Return

integer:

GetGridY()

This action returns this Control's cell y-coordinate within a GridLayout. This indicates which row this Control is located within. If the Control's parent container isn't using a GridLayout, this value is ignored.

Return

integer:

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()

GetHeight()

This action will return the currently set height of the Item2D.

Return

number:

Example

use Libraries.Interface.Item2D
Item2D myItem
number height = myItem:GetHeight()

GetHorizontalLayoutMode()

The GetHorizontalLayoutMode is used to determine how the width of a Control is calculated. It should be one of the following constants: STANDARD, which will calculate the width as a set number of pixels plus a percentage of the container's width. FILL, which will make the width fill the remaining width of the container. FIT_CONTENTS, which will calculate the width to fit the children contents.

Return

integer: the integer that maps to the layout mode constant, one of STANDARD, FILL, or FILL_CONTENTS.

GetIcon()

This action gets the Icon (typically an image or texture) used by this Control. Different Controls use this Icon differently, depending on their purpose.

Return

Libraries.Game.Graphics.TextureRegion:

GetIconColor()

This action gets the Icon color from the control.

Return

Libraries.Game.Graphics.ColorGroup: the icon color.

GetInertia()

This action gets the rotational inertia of this item. The inertia is in kilogram units squared.

Return

number: The inertia of this item in kilogram units squared

Example

use Libraries.Interface.Item2D

Item2D item
item:SetWidth(100)
item:SetHeight(100)
item:EnablePhysics(true)
item:SetMass(20)
number inertia = item:GetInertia()

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()

GetInterfaceOptionsKey()

This action sets the base Font size to be used by this Control, if the Control uses a Font.

Return

text:

GetInterfaceScale()

This action sets the interface scale for the control.

Return

number: the scale, a number between 0 and 1 that scales the control.

GetInverseInertia()

This action gets the inverse inertia of this item (i.e., one divided by the inertia of this item). Physics must be enabled on this item before using this action.

Return

number: The inverse inertia of this item

Example

use Libraries.Interface.Item2D

Item2D item
item:SetWidth(100)
item:SetHeight(100)
item:EnablePhysics(true)
item:SetMass(20)
number inverseInertia = item:GetInverseInertia()

GetInverseMass()

This action gets the inverse mass of the item (i.e., one divided by the mass of this item). Physics must be enabled on this item before using this action.

Return

number: The inverse mass of this item

Example

use Libraries.Interface.Item2D

Item2D item
item:SetWidth(100)
item:SetHeight(100)
item:EnablePhysics(true)
item:SetMass(20)
number inverseMass = item:GetInverseMass()

GetItem(integer index)

This action returns an Item2D that was previously added to this Item2D by finding it at the given index in the internal array of children Items.

Parameters

  • integer index

Return

Libraries.Interface.Item2D:

Example

use Libraries.Interface.Item2D

Item2D parentItem
Item2D child1
Item2D child2
parentItem:Add(child1)
parentItem:Add(child2)
Item temp = parentItem:GetItem(0)

GetItemAt(number x, number y)

This action searches through all Items stored in this Item2D and finds the deepest Item which contains the given point in global coordinates.

Parameters

  • number x
  • number y

Return

Libraries.Interface.Item2D: The deepest item in the children hierarchy at the given point.

Example

use Libraries.Interface.Item2D

Item2D parentItem
Item2D child
Item2D grandchild
parentItem:Add(child)
child:Add(grandchild)
grandchild:SetHeight(100)
grandchild:SetWidth(100)
Item2D temp = parentItem:GetItemAt(75, 75)

GetItemCount()

This action returns the number of items contained in this Item2D.

Return

integer:

Example

use Libraries.Interface.Item2D

Item2D parentItem
Item2D child1
Item2D child2
parentItem:Add(child1)
parentItem:Add(child2)
integer size = parentItem:GetItemCount()

GetItems()

This action returns an iterator containing all the items contained in this Item2D.

Return

Libraries.Containers.Iterator:

Example

use Libraries.Interface.Item2D
use Libraries.Containers.Iterator

Item2D parentItem
Item2D child1
Item2D child2
parentItem:Add(child1)
parentItem:Add(child2)
Iterator<Item2D> iterator = parentItem:GetItems()

GetJointList()

This is an action used internally to retrieve the head of the liked list of joints connected to this item. This action is used internally and users should not need to use this action.

Return

Libraries.Game.Physics.Joints.JointEdge2D: The head of the linked list of connected joints

GetLabel()

For internal use only.

Return

Libraries.Game.Graphics.Label:

GetLabelText()

This action returns the text used for this Control's label, if it has one.

Return

text: The text of this Control's label.

GetLayer()

This action returns the current Layer2Dthat this Item2D is a part of in the Game libraries.