Skip to main content

Page

An Action Wheel container which is used to store up to 8 actions

For the entire page assume:

local myPage = action_wheel:newPage()

Action

newAction()

Adds a new Action on the selected Page's index

If no index is given it is added in the first available index

newAction()

Returns:

TypeDescription
ActionAn action wheel action

Example:

local myAction = myPage:newAction()

getAction()

Gets an Action from the Page's given index

getAction(index)

Parameters:

NameTypeDescriptionDefault
indexIntegerThe slot to get the action fromRequired

Returns:

TypeDescription
ActionAn action wheel action

Example:

myPage:getAction(1)

getActions()

Gets a table of the Actions shifted by the given number

If no shift is specified, it returns all Actions from this page

Note that the table is indexed as its slot number as key, so blank slots will result in nil values

getActions()

Returns:

TypeDescription
TableA table that contains all actions in the page

Example (Overload 1):

myPage:getActions()

setAction()

Aliases: action()

Sets an Action in the Page's given index

If index is -1, the action will be set in the latest empty index

setAction(index, action)

Parameters:

NameTypeDescriptionDefault
indexIntegerThe slot on the page to set the action toRequired
actionActionAn action wheel actionRequired

Returns:

TypeDescription
PageReturns self for chaining

Example:

local myAction = action_wheel:newAction()
myPage:setAction(-1, myAction)

Slot

setKeepSlots()

Sets if this page's current slots should be reset when adding this page on the Action Wheel

setKeepSlots(bool)

Parameters:

NameTypeDescriptionDefault
boolBooleanIf true the slots won't be reset, if false they willfalse

Returns:

TypeDescription
PageReturns self for chaining

Example:

myPage:setKeepSlots(true)

shouldKeepSlots()

Gets if this page's current slots should be reset when adding this page on the Action Wheel

shouldKeepSlots()

Returns:

TypeDescription
BooleanIf true the slots won't be reset, if false they will

Example:

myPage:shouldKeepSlots(true)

setSlotsShift()

Aliases: slotsShift()

Sets this page's current slots shift

Slots 1-8 are shift 1, slots 9-16 are 2, etc

setSlotsShift(shift)

Parameters:

NameTypeDescriptionDefault
shiftIntegerThe page shift that will be visible1

Returns:

TypeDescription
PageReturns self for chaining

Example:

myPage:setSlotsShift(1)

getSlotsShift()

Gets this page's current slots shift

Slots 1-8 are shift 1, slots 9-16 are 2, etc

getSlotsShift()

Returns:

TypeDescription
IntegerThe page shift that is visible

Example:

myPage:getSlotsShift()

Misc

getTitle()

Returns the title of this Page

getTitle()

Returns:

TypeDescription
StringThe name for the page that is used internally

Example:

myPage:getTitle()

Fields

keepSlots

Whether or not this page's current slots should be reset when adding this page on the Action Wheel

See setKeepSlots for an example of how to set it

Example:

myPage.keepSlots = true