Libraries.Interface.Controls.Charts.BoxPlot Documentation

The BoxPlot class is Chart object that inherits from Control and like other UI elements it is added to the Game class. The Box Plot is used as an indication of how the values in the data are spread out. Box Plots can also be used to compare datasets for more than one group. The title label, axis labels, and scales can be modified. Any number of plots can be added.

Example Code

use Libraries.Compute.Statistics.DataFrame
use Libraries.Compute.Statistics.Charts.BoxPlotCreator
use Libraries.Interface.Controls.Charts.BoxPlot
use Libraries.Game.Game

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        DataFrame frame
        frame:Load("Data/Data.csv")
        BoxPlotCreator creator
        creator:AddColumn(2)
    
        BoxPlot chart = cast(BoxPlot,frame:CreateChart(creator))
        chart:SetPercentageWidth(1)
        chart:SetPercentageHeight(1)
        chart:SetTitle("Sample Title")
        chart:SetXAxisTitle("X-axis Variable")
        chart:SetYAxisTitle("Y-axis Variable")
        Add(chart)
    end
end

Inherits from: Libraries.Interface.Controls.Charts.Chart, Libraries.Interface.Controls.Control, Libraries.Interface.Item, Libraries.Interface.Controls.Charts.ChartItem, Libraries.Interface.Item2D, Libraries.Language.Object

Actions Documentation

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.

Activate(Libraries.Interface.Events.BehaviorEvent event)

Returns true if rendering the focus event.

Parameters

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

AddChartAreaInstructions(text description)

This action generates the instruction text for the Chart Area description.

Parameters

  • text description: The base portion of the description that will appear before the instructions

AddChartItemInstructions(Libraries.Interface.Item chartItem, text description)

This action generates the instruction text for a chart item description.

Parameters

  • Libraries.Interface.Item: The chart item that will have the instructions
  • text description: The base portion of the description that will appear before the instructions

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)

AddGroupPanel(Libraries.Interface.Controls.Charts.GroupPanel group)

This action is used by the layout to position the graphical components of the Chart. Layout is handled automatically so users don't need to use this action directly.

Parameters

AddGroupPanelInstructions(Libraries.Interface.Controls.Charts.Graphics.ChartDrawable groupPanel, text description)

This action generates the instruction text for a group panel description.

Parameters

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)

AddPlotGroup(Libraries.Interface.Controls.Charts.Graphics.PlotGroup group)

Appends a plotgroup to the boxplot plot groups container.

Parameters

AddPlotItemInstructions(Libraries.Interface.Item chartItem, text description)

This action generates the instruction text for a plot item description.

Parameters

  • Libraries.Interface.Item: The chart item that will have the instructions
  • text description: The base portion of the description that will appear before the instructions

AddSelectionListener(Libraries.Interface.Events.SelectionListener listener)

This action adds the given SelectionListeners to the Control.

Parameters

AddSeries(Libraries.Interface.Controls.Charts.Series series)

This action adds to the list of Series.

Parameters

AddSubChartAreaInstructions(Libraries.Interface.Controls.Charts.ChartAreaPanel subChartArea, text description)

This action generates the instruction text for a sub chart area description.

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)

AdjustForLegend()

This action adjusts the chart for the legend.

AdjustForXAxis()

This action adjusts for the x-axis.

AdjustForYAxis()

This action adjusts for the y-axis.

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.

CheckPlatformInstructions()

This action is used to check the current platform and adjust the command instructions to use gestures rather than keys

Example

use Libraries.Compute.Statistics.DataFrame
use Libraries.Interface.Controls.Charts.BarChart

DataFrame frame
frame:Load("Data.csv")
frame:AddSelectedColumn(1)
BarChart chart = frame:BarChart()
chart:CheckPlatformInstructions

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)

ConvertToScalableVectorGraphics(boolean hasAccessibility)

This action converts this chart to a text value that contains information for a scalable vector graphics file. This is useful for saving charts to disk. Each sub-class of chart must implement this action separately.

Parameters

  • boolean hasAccessibility: flag to tell the ChartWriter if it should include accessibility elements and tags.

Return

text: the Scalable Vector Graphics (SVG) text.

ConvertToScalableVectorGraphics()

This action converts this chart to a text value that contains information for a scalable vector graphics file. This is useful for saving charts to disk. Each sub-class of chart must implement this action separately.

Return

text: the Scalable Vector Graphics (SVG) text.

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

Display(boolean exit)

This action creates a default Game object for displaying charts and sets this chart as the sole display. It is useful for interacting with charts without creating a complex game setup. The exit flag tells the system, if true, to close the pre-built display right after completing layout, which can be useful for writing to disk.

Parameters

  • boolean exit

Display(integer width, integer height)

This action creates a default Game object for displaying charts and sets this chart as the sole display. It is useful for interacting with charts without creating a complex game setup.

Parameters

  • integer width
  • integer height

Display()

This action creates a default Game object for displaying charts and sets this chart as the sole display. It is useful for interacting with charts without creating a complex game setup.

Display(integer width, integer height, boolean exit)

This action creates a default Game object for displaying charts and sets this chart as the sole display. It is useful for interacting with charts without creating a complex game setup. The exit flag tells the system, if true, to close the pre-built display right after completing layout, which can be useful for writing to disk.

Parameters

  • integer width
  • integer height
  • boolean exit

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.

DisposeDrawables()

DisposeDrawables Empties drawables from the chart area.

DoSpecialNavigation(integer navigationType)

This action triggers special navigation behavior in the specified navigation direction. This behavior overrides the typical navigation provided by the chart. This will only be called by the Chart if the HasSpecialNavigation action returns true for the provided parameter. By default this does nothing, but some classes may override this with custom behavior.

Parameters

  • integer navigationType

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)

FlipOrientation()

If not already changed, this action will flip the axis at the current state.

Example

//Would result in the y-axis having the title "My X title" and the x-axis having the title "My Y title"
chart:SetXAxisTitle("My X title")
chart:SetYAxisTitle("My Y title")
chart:FlipOrientation() // Flipping after setting titles
    
//Would result in the y-axis having the title "My Y title" and the x-axis having the title "My X title"
chart:FlipOrientation() // Flipping before setting titles
chart:SetXAxisTitle("My X title")
chart:SetYAxisTitle("My Y title")

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 obtains the displayable name for this region of the chart.

GenerateInfoTree()

GenerateInfoTree Generates the tree of ChartItems that define how the chart will be navigated and what extra information might be sent to the screen reader.

GenerateSummary()

This is called by GenerateInfoTree to generate the summary that is heard when you first focus on the chart. Also the highest level of the information tree of the chart.

Return

text:

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

Return

Libraries.Interface.Behaviors.Behavior:

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

GetBackground()

This action gets the Drawable in the background of the chart.

Return

Libraries.Game.Graphics.Drawable: the chart background Drawable.

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

GetChartArea()

This action is used by the layout to position the graphical components of the Chart. Layout is handled automatically so users don't need to use this action directly.

Return

Libraries.Interface.Controls.Charts.ChartAreaPanel:

GetChartAreaHeightPercent()

This action gets the chart area height percent of the whole chart height.

Return

number:

GetChartAreaWidthPercent()

This action gets the chart area width percent of the whole chart width.

Return

number:

GetChartItemText()

This action converts this chart to a text value that contains information for a scalable vector graphics file. This is useful for saving charts to disk. Each sub-class of chart must implement this action separately.

Return

text: the Scalable Vector Graphics (SVG) text.

GetChartItemsText()

Add LEFT/RIGHT navigation

Return

text:

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:

GetContainer()

This action get the current chart object.

Return

Libraries.Interface.Controls.Charts.Chart: the chart object.

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

This action defines what the default font is for this control. This allows individual controls to customize their default font properties on a per control basis.

Return

text:

Example

use Libraries.Interface.Controls.TextBox

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

GetDefaultFontSize()

This action defines what the default font size for this control. This allows individual controls to customize their default font properties on a per control basis.

Return

integer:

Example

use Libraries.Interface.Controls.TextBox

TextBox box
integer size = box:GetDefaultFontSize()
output size

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

GetDisplayName()

This action obtains the displayable name for this region of the chart.

Return

text: the display name

GetDownItem()

Returns the Item accessed "below" (via the DOWN arrow) this Item in the chart selection.

Return

Libraries.Interface.Controls.Charts.ChartItem:

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:

GetEnterInstruction()

This action gets the instruction text for an enter description.

Return

text: The description for enter.

GetEnterItem()

Returns the Item accessed within (default: ENTER key) this Item in the chart selection.

Return

Libraries.Interface.Controls.Charts.ChartItem:

GetEscapeItem()

Returns the escape Item accessed from this Item in the chart selection (by default using the ESCAPE key).

Return

Libraries.Interface.Controls.Charts.ChartItem:

GetExitInstruction()

This action gets the instruction text for an exit description.

Return

text: The description for exit.

GetFactorList()

Returns an array of the factor/group names

Return

Libraries.Containers.Array: Array an array of factors/groups in the chart.

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.

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: