Binding of Isaac - Afterbirth+ Lua Reference/Guide
|
Functions | |
boolean | IsButtonTriggered (integer button, integer controllerId) |
boolean | IsButtonPressed (integer button, integer controllerId) |
float | GetButtonValue (integer button, integer controllerId) |
boolean | IsActionTriggered (integer action, integer controllerId) |
boolean | IsActionPressed (integer action, integer controllerId) |
float | GetActionValue (integer action, integer controllerId) |
boolean | IsMouseBtnPressed (integer button) |
Vector | GetMousePosition (boolean gameCoords) |
float Input::GetActionValue | ( | integer | action, |
integer | controllerId | ||
) |
Returns the current strength in which a button was pressed. This is 0 OR 1 with a keyboard. With a controller, this can be used to get the strength in which you have moved the analog stick in a direction.
print(Input.GetActionValue(ButtonAction.ACTION_LEFT, 1))
float Input::GetButtonValue | ( | integer | button, |
integer | controllerId | ||
) |
Use "GetActionValue" instead of this function.
Vector Input::GetMousePosition | ( | boolean | gameCoords | ) |
Returns the current mouse position in game coordinates (true) or render coordinates.
local mousePos = Isaac.WorldToScreen(Input.GetMousePosition(true))-- transfer game- in screen coordinates
Isaac.RenderText("Hello World!", mousePos.X, mousePos.Y, 1 ,1 ,1 ,1 )
boolean Input::IsActionPressed | ( | integer | action, |
integer | controllerId | ||
) |
Returns, if an action-button is pressed or not. An Action-button is any button that got a default function assigned to it. This function will return true, as long the button is held down.
if Input.IsActionPressed(ButtonAction.ACTION_BOMB, 0) then
print("bomb Button pressed")
end
boolean Input::IsActionTriggered | ( | integer | action, |
integer | controllerId | ||
) |
Returns, if an action-button was pressed some time before or not. An Action-button is any button that got a default function assigned to it. This functions will only return true, if the button was pressed down. It will no longer return true, after you called this function and try to call it in the next update cycle (for example in the next render cycle).
if Input.IsActionTriggered(ButtonAction.ACTION_BOMB, 0) then
print("bomb Button pressed")
end
boolean Input::IsButtonPressed | ( | integer | button, |
integer | controllerId | ||
) |
Returns, if a button is pressed or not. This function will return true, as long the button is held down.
if Input.IsButtonPressed(Keyboard.KEY_ENTER, 0) then
print("Enter Button pressed.")
end
boolean Input::IsButtonTriggered | ( | integer | button, |
integer | controllerId | ||
) |
Returns, if a button was pressed some time before or not. This functions will only return true, if the button was pressed down. It will no longer return true, after you called this function and try to call it in the next update cycle (for example in the next render cycle).
if Input.IsButtonTriggered(Keyboard.KEY_ENTER, 0) then
print("Enter Button was pressed.")
end
boolean Input::IsMouseBtnPressed | ( | integer | button | ) |
Returns, if a mousebutton is pressed or not.
Left: 0, Right: 1, mousewheel: 2, back button: 3, forward button: 4
if Input.IsMouseBtnPressed(1) then
print("Right Click")
end