Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Input Functions

akesi lili provides input functions to handle user interactions, such as button presses and mouse movements. These functions allow you to detect and respond to various input events, enhancing the interactivity of your game.

btn

|button: Number|

Checks if the specified button is currently pressed.

Parameters

  • button: The button to check.
    • 0: A
    • 1: B
    • 2: Start
    • 3: Select
    • 4: Left
    • 5: Right
    • 6: Up
    • 7: Down
    • 8: Mouse

Returns

true if the button is pressed, false otherwise (Bool).

Example

is_pressed = btn(1)

mouse

||

Returns the current position of the mouse pointer.

Returns

A Map containing the mouse coordinates with x and y keys.

Example

mouse_pos = mouse()
print mouse_pos.x, mouse_pos.y

scroll_off

||

Returns the current scroll offset delta.

Returns

A Map containing the scroll offset delta with x and y keys.

Example

scroll = scroll_off()
print scroll.x, scroll.y

These input functions are essential for creating interactive and responsive game experiences in akesi lili.