Repository navigation
Event Queue
Mtax edited this page Mar 27, 2025
·
2 revisions
The Event Queue is an Object Asset with code operating Event Methods of repeated Events added by Instances of Instantiable Constructors to its Priority Queues, using their scope. A single instance of the Event Queue must be created during the runtime before any Instantiable Constructors are constructed. The Event Queue itself should execute its own Events after every other Instance, so that Event Methods are executed without a delay in the same frame they were submitted into it. As GameMaker appears to execute Instance code based on alphabetical order of names their Object Assets have, the actual name of the Event Queue Object Asset is
The execution of Event Methods added into its
zzzzz_EventQueue, prefixed with several symbols that are last in the alphabetical ordering. The code of this Object Asset declares a macro allowing referring to it by the name EventQueue. This is the only macro used in GML Instantiable Constructors framework.
The execution of Event Methods added into its
step Priority Queue is divided into cycles based on target frame rate of the application. If it exceeds 60, the content of step Priority Queue will not be executed every single frame, skipping execution in some frames in favor of a rate mimicking the amount of executions of target frame rate equaling 60. Otherwise, if the target frame rate is 60 or less, the content of step Priority Queue will be executed every frame. The everyStep Priority Queue is not subjected to this behavior and is operated every frame. The Instance constructor and constructors inheriting it specify which of these Priority Queues they use through their stepEventQueue static property.
Destruction |
Elements |
None |
Name |
Type |
Default |
Modifiable |
Description |
instanceLayer |
{Layer} |
Yes |
Used by Instance.createInstance() to instantiate Instance.object. By default, uses the layer on which EventQueue was created on. |
|
step |
Not applicable |
Yes |
Executes Event Methods it contains during a Step Event of the EventQueue if a cycle completed that frame. |
|
draw |
Not applicable |
Yes |
Executes Event Methods it contains during every Draw Event of the EventQueue if its visible Built-In Instance Variable is set to true. |
|
drawGUI |
Not applicable |
Yes |
Executes Event Methods it contains during every Draw GUI Event of the EventQueue if its visible Built-In Instance Variable is set to true. |
|
cycle |
{real} |
1 |
No |
States which part of the frame cycle is the current frame. Each frame, 60 divided by target frame rate is added to it. Then, If it equals or exceeds 1, the content of step PriorityQueue is executed and the value becomes 0. |
frameIsStep |
{bool} |
true |
No |
States whether the content of step PriorityQueue is executed this frame. |
Contents
The Hierarchy
● Event Queue● Blueprint Objects
● Instantiable Constructors
● Constructors inheriting Instantiable Constructors
Concepts