Scheduler

Schedule functions to run in the future.

Summary

Type
Function

Function

void Schedule(int frameDelay, function callback, any... ...)

Function

void Empty()

Enumerators

ONE_SECOND

int Enum.ONE_SECOND

This is equal to 30, which is how many frames there are in a second.

Methods

Schedule()

void Schedule(int frameDelay, function callback, any... ...)

Schedule callback to run with all arguments provided (... is a variadic argument) after frameDelay frames have passed.

Example
local Scheduler = IsaacHelper.GetModule("Scheduler")

local function AwesomePrint(str, num)
    print(str)
    print("Oh also my favorite number is " .. num)
end

-- 4 seconds from now, AwesomePrint will run with the provided arguments.
Scheduler.Schedule(Scheduler.Enum.ONE_SECOND * 4, AwesomePrint, "Hey, wanna be friends?", 26)

Empty()

void Empty()

Cancel all scheduled tasks. This is called internally when the game is exited or on gameover.

Last updated