VISU - PHP Game Framework

InputContextMap
in package

Table of Contents

Properties

$actions  : InputActionMap
Current actions map Do not modify this property!
$dispatcher  : Dispatcher
$eventHandlerIdInputKey  : int
The function id of the event handler
$eventHandlerIdInputMouseButton  : int
$eventHandlerIdInputMouseClick  : int
$nextUpdateActionsMap  : InputActionMap|null
The action map that should be applied on the next update
$registeredActionMaps  : array<string, InputActionMap>
Array of InputActionMap instances bound to a context name

Methods

__construct()  : mixed
Constructor
__destruct()  : mixed
Destructor
handleKeySignal()  : void
Handles the given key signal to update internal action states
handleMouseButtonSignal()  : void
Handles the given mouse button signal to update internal action states
handleMouseClickSignal()  : void
Handles Mouse click signals to update internal action states
register()  : void
Registers the given action map to the given context
registerAndActivate()  : void
Registers and activates the given action map to the given context
reset()  : void
Resets the internal action states
switchTo()  : void
Switches to the action map bound to the given context
switchToNext()  : void
Switches to the action map bound to the given context on the next update.

Properties

$eventHandlerIdInputKey

The function id of the event handler

private int $eventHandlerIdInputKey = -1

$eventHandlerIdInputMouseButton

private int $eventHandlerIdInputMouseButton = -1

$eventHandlerIdInputMouseClick

private int $eventHandlerIdInputMouseClick = -1

$registeredActionMaps

Array of InputActionMap instances bound to a context name

private array<string, InputActionMap> $registeredActionMaps = []

Methods

handleKeySignal()

Handles the given key signal to update internal action states

public handleKeySignal(KeySignal $signal) : void
Parameters
$signal : KeySignal

registerAndActivate()

Registers and activates the given action map to the given context

public registerAndActivate(string $context, InputActionMap $actionMap) : void
Parameters
$context : string
$actionMap : InputActionMap

switchTo()

Switches to the action map bound to the given context

public switchTo(string $context) : void
Parameters
$context : string

switchToNext()

Switches to the action map bound to the given context on the next update.

public switchToNext(string $context) : void

This can be really helpful when you want to switch to a new context but you don't want to reset the current context until the next update, all action are done..

Parameters
$context : string

        
On this page

Search results