An enum value for the init section in the loop.
The init section is used for initialization tasks that happen before
updates, like when a new entity is created, it can be added to a queue and
processed in init to set some default values before it arrives in sim or visual.
An enum value for the sim section in the loop.
The sim section is for simulation, also known as update.
In this section you would update game logic and modify things that the visual section would reference.
An enum value for the visual section in the loop.
The visual section is for rendering, also known as render.
Updating visual state from the sim states happens here.
An enum value for the debug section in the loop.
The debug part of the loop can perform debug related tasks before the end of the frame and rendering is submitted.
Once off. Queue a function to be called after the current section has completed fully.
That is, if we were inside of sim and we queued a function, it would happen after beforeon and after.
This is used for systems that fire callbacks, you normally don’t want to fire callbacks during processing,
so you can queue them to happen “as soon as possible” but in a well defined place and time.
Frame.queue {
Log.print("happens at the end of the current section")
Schedule a function to be called in future.
The time value is in seconds, and is not affected by any time scaling.
The function is only called once. To repeat, see the other schedule method.
Schedule a function to be called in future.
The time value is in seconds, and is not affected by any time scaling.
If count is 0, the function will be called repeatedly until unschedule is called.
Disconnect a function using the handle returned from one of the recurring functions.
This will remove the function from the loop and it will no longer be called.
Returns true if the function was valid and removed.
var tick = Frame.on(Frame.sim) {|delta| Log.print("delta:%(delta)") }
Once off. Queues a function to the specified section, with a given priority which will be executed during the section.
Priority is based on “highest priority first”. So priority 1 executes before 0.
Returns a handle that can be used to remove the function via off.
Connect a function to the specified section, with a given priority which will be executed during the section.
Priority is based on “highest priority first”. So priority 1 executes before 0.
Returns a handle that can be used to remove the function via off.
Connect a function to the specified section, with a given priority which will be executed before the section.
Priority is based on “highest priority first”. So priority 1 executes before 0.
Returns a handle that can be used to remove the function via off.
Connect a function to the specified section, with a given priority which will be executed after the section.
Priority is based on “highest priority first”. So priority 1 executes before 0.
Returns a handle that can be used to remove the function via off.
Once off. Queue a function to the specified section (with priority 0) which will be executed during the section.
Returns a handle that can be used to remove the function via off.
Frame.once(Frame.sim) { Log.print("happens during 'sim'") }
Once off. Queue a function to be called at the beginning of the frame count_frames from now,
before any sections. This is Frame.next but can push actions forward by frame count instead of time.
An enum value for the init section in the loop.
The init section is used for initialization tasks that happen before
updates, like when a new entity is created, it can be added to a queue and
processed in init to set some default values before it arrives in sim or visual.
An enum value for the sim section in the loop.
The sim section is for simulation, also known as update.
In this section you would update game logic and modify things that the visual section would reference.
An enum value for the visual section in the loop.
The visual section is for rendering, also known as render.
Updating visual state from the sim states happens here.
An enum value for the debug section in the loop.
The debug part of the loop can perform debug related tasks before the end of the frame and rendering is submitted.