EngineInterface
ResourceIdByName
Converts the name of a resource into its ID.
Arguments
Name | Type | Description |
---|---|---|
|
| The name of the resource. (e.g. |
Returns
Type | Description |
---|---|
| The resource ID. |
Example
local engine = API.GetEngine()
local res_id = engine:ResourceIdByName("obj_player")
GetObjectById
Gets an object reference from its ID.
Arguments
Name | Type | Description |
---|---|---|
|
| The ID of the object. |
Returns
Type | Description |
---|---|
The object reference. |
Example
local engine = API.GetEngine()
local obj = engine:GetObjectById(0)
GetObjectByName
Gets an object reference from its name.
Arguments
Name | Type | Description |
---|---|---|
|
| The name of the object. |
Returns
Type | Description |
---|---|
The object reference. |
Example
local engine = API.GetEngine()
local obj = engine:GetObjectByName("obj_player")
Eval
Evaluates GML code using the built-in GML interpreter.
Arguments
Name | Type | Description |
---|---|---|
|
| The code to evaluate. |
Example
local engine = API.GetEngine()
engine:Eval([[var msg = "Hello from GML!";
show_message(msg);
game_end();]])
Last modified: 29 March 2025