Skip to content

FrameEvent

Hyomoto edited this page Jun 13, 2021 · 11 revisions
Jump To Go Back Arguments Methods Variables

FrameEvent( event, delay, function )

Implements: Struct

Creates a new event that will be updated based on delta time. After the time has elapsed the event will be triggered. If the event is flagged to only happen once, it will be discarded afterwards, otherwise it will start the counter over again.\n FAST.CREATE FAST.GAME_END FAST.ROOM_START FAST.ROOM_END FAST.STEP_BEGIN FAST.STEP FAST.STEP_END FAST.ASYNC_SYSTEM

event = new FrameEvent( FAST.STEP, 30, function() {
    show_debug_message( "Hello World!" );
}).once();
Output: Hello World! is written to the console after 30 frames.

Arguments

Name Type Purpose
event int The event this should happen during
delay int How many frames before firing
function [func](func) The function to call when the delay has passed

Methods

Jump To top update trigger once discard parameter toString

update( )

Name Type Purpose
None

Called to update the event.


trigger( )

Returns: self

Name Type Purpose
None

Triggers the event to happen now. This does not affect timing, but if the event is set to happen once, it will cause it to be discarded as well.


once( )

Returns: self

Name Type Purpose
None

Flags the event to only be performed once. Once triggered, either by timing or manually, the event will be discarded.


discard( )

Name Type Purpose
None

Discards the event from the FAST event system. Note: if you maintain the reference to the event it will still exist and can be updated or triggered manually. Discarding only removes it from the FAST event system.


parameter( parameter )

Returns: self

Name Type Purpose
parameter mixed The parameter to pass

Sets the event parameter that will be passed into the function when it is triggered.


toString( )

Name Type Purpose
None

Returns the event as a string, for debugging.


Variables

Jump To top
Name Type Initial Purpose
__Tick int 0 How many frames have passed since event creation/restart.
__Tock int _delay What tick this event should fire on
__Repeat= bool If true, will loop after the event fires. otherwise it is discarded.
__Func method _function The function this event calls
__Event int _event The event during which the function will be triggered
__Ignore= bool If true, this event will not fire, it will still cycle and/or discard.
__Param mixed undefined A value that will be passed into the event when triggered
Clone this wiki locally