Scene:action_pressed

Called from love.update when a player presses a key or button bound to an action.

A common usage of this callback is to forward calls to your scene’s InputSystem.

Usage

scene:action_pressed(player_index, action)

Arguments

Name Type Description
player_index number Number identifying the player who emitted the input.
action string Action that was pressed (eg. "jump", "attack", etc.).

Examples

local MyScene = Class("MyScene", crystal.Scene);

MyScene.action_pressed = function(self, player_index, action)
  print("Player #" .. player_index .. " pressed " .. action .. ".");
end

This site uses Just the Docs, a documentation theme for Jekyll.