Open Asterune
ActionContext

ActionContext

Groups input-action bindings with a shared priority and modal state.

Behavior

ActionContext groups input-action bindings with a shared priority and modal state.

Summary

Members15
Properties4
  • Whether this context dispatches its bound actions.

  • Whether this context blocks dispatch to lower-priority contexts.

  • Name: stringread only

    The context name supplied when it was created.

  • The context priority used when dispatching input.

Methods11

Properties

Enabled

ActionContext.Enabled: boolean

Whether this context dispatches its bound actions.

Modal

ActionContext.Modal: boolean

Whether this context blocks dispatch to lower-priority contexts.

Name

ActionContext.Name: string

The context name supplied when it was created.

Priority

ActionContext.Priority: number

The context priority used when dispatching input.

Methods

BindAction

ActionContext:BindAction(actionName: string, functionToBind: (actionName: string, inputState: EnumItem, inputObject: InputObject) -> EnumItem?, createTouchButton: boolean?, args: ...EnumItem): ()

Binds a named action to input codes within this context.

BindActionAtPriority

ActionContext:BindActionAtPriority(actionName: string, functionToBind: (actionName: string, inputState: EnumItem, inputObject: InputObject) -> EnumItem?, createTouchButton: boolean, priority: number | EnumItem, args: ...EnumItem): ()

Binds a named action at an explicit priority. The callback receives the action name, input state, and InputObject. Return Enum.ContextActionResult.Sink to consume the input or Pass to continue dispatch.

Destroy

ActionContext:Destroy(): ()

Removes this context and its action bindings.

GetActionButton

ActionContext:GetActionButton(actionName: string): ImageButton?

Returns the touch button created for the named action, or nil if no button exists.

GetBoundActions

ActionContext:GetBoundActions(): { BoundActionInfo }

Returns information about the registered action bindings.

SetActionDescription

ActionContext:SetActionDescription(actionName: string, description: string): ()

Sets the description of a named action's touch button.

SetActionImage

ActionContext:SetActionImage(actionName: string, image: string): ()

Sets the image of a named action's touch button.

SetActionPosition

ActionContext:SetActionPosition(actionName: string, position: UDim2): ()

Sets the position of a named action's touch button.

SetActionTitle

ActionContext:SetActionTitle(actionName: string, title: string): ()

Sets the title of a named action's touch button.

UnbindAction

ActionContext:UnbindAction(actionName: string): ()

Removes the binding for the specified action.

UnbindAllActions

ActionContext:UnbindAllActions(): ()

Removes all bindings in this context.

Operators

__eq · __tostring · __type

Used by

InputService