Skip to content

PauseAPI

Generic typesno constructorsource

Control the pause API

Fields

blocked

boolean

Is true when PauseAPI is freezing the game.

source

ignore_screen

PAUSE_SCREEN

Bitmask for game SCREEN where the PRE_✱ pause types are ignored, even though enabled in pause. Can also use the special cases [FADE, EXIT] to unfreeze temporarily during fades (or other screen transitions where player input is probably impossible) or the level exit walk of shame.

source

ignore_screen_trigger

PAUSE_SCREEN

Bitmask for game SCREEN where the triggers are ignored.

source

last_fade_timer

integer

Fade timer stamp when fade triggers were last checked.

source

last_instance

boolean

Set to true to run pause logic and triggers only in the last API instance in the chain (Playlunky) when multiple instances of the API (Overlunky and Playlunky) are injected.

source

last_trigger_frame

integer

Global frame stamp when one of the triggers was last triggered, used to prevent running them again on the same frame on unpause.

source

modifiers_block

integer

Bitmask of modifier KEYs that will block all game input

source

modifiers_clear_input

boolean

Enable to clear affected input when modifiers are held, disable to ignore all input events, i.e. keep held button state as it was before pressing the modifier key

source

modifiers_down

integer

Bitmask of modifier KEYs that are currently held

source

pause

PAUSE_TYPEproperty

Current pause state bitmask. Use custom PAUSE_TYPE.PRE_✱ (or multiple) to freeze the game at the specified callbacks automatically. Checked after the matching ON update callbacks, so can be set on the same callback you want to block at the latest. Vanilla PAUSE flags will be forwarded to state.pause, but use of vanilla PAUSE flags is discouraged and might not work with other PauseAPI features.

source

pause_screen

PAUSE_SCREEN

Bitmask to only enable PAUSE_TRIGGER.SCREEN during specific SCREEN, or any screen when NONE.

source

pause_trigger

PAUSE_TRIGGER

Bitmask for conditions when the current pause_type should be automatically enabled in pause, can have multiple conditions.

source

pause_type

PAUSE_TYPE

Pause mask to toggle when using the PauseAPI methods to set or get pause state.

source

skip

boolean

Set to true to unfreeze the game for one update cycle. Sets back to false after ON.POST_GAME_LOOP, so it can be used to check if current frame is a frame advance frame.

source

skip_fade

boolean

Set to true to skip all fade transitions, forcing fade_timer and fade_value to 0 on every update.

source

unpause_screen

PAUSE_SCREEN

Bitmask to only enable PAUSE_TRIGGER.SCREEN during specific SCREEN, or any screen when NONE.

source

unpause_trigger

PAUSE_TRIGGER

Bitmask for conditions when the current pause_type should be automatically disabled in pause, can have multiple conditions.

source

update_camera

boolean

Set to true to enable normal camera movement when the game is paused or frozen on a callback by PauseAPI.

source

Methods

frame_advance

function PauseAPI:frame_advance()
source

get_pause

function PauseAPI:get_pause(): PAUSE_TYPE

Returns PAUSE_TYPE

source

loading

function PauseAPI:loading(): boolean

Returns boolean

source

paused

function PauseAPI:paused(): boolean

Returns boolean

source

set_pause

function PauseAPI:set_pause(flags: PAUSE_TYPE)
flags: PAUSE_TYPE
source

set_paused

function PauseAPI:set_paused(enable: boolean): boolean
enable: boolean

Returns boolean

source

toggle

function PauseAPI:toggle(): boolean

Returns boolean

source