Referencia de funciones
GameMaker Studio · GML · Setup & session
gmda_setLeaderboard
Declares the leaderboard table keys; argument order is each table's 1-based number. Up to 10.
Synchronous (returns directly)
Signature
gmda_setLeaderboard(key1, [key2], ... up to 10) -> realWhat it does
Stores the table keys, resets the cached best score, position and extra info for each, and (re)creates the local ds_grid that backs each table. Once the session is active gmda_Updatefunction() loads each table once and emits tables_loaded { success } when they are all in.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| key1 | string | required | The first table key from the panel. This becomes table 1 in every other leaderboard call. |
| key2 | string | optional | Additional table keys, in order. Each argument's position is its 1-based table number (key2 = table 2, and so on). Up to 10 keys total. |
How to call it
Call once in the controller Create event, right after gmda_setController(). Pass the keys as separate arguments, not as an array.
Returns: 1
Example
gmda_setLeaderboard("main_normal", "main_chaotic");
// "main_normal" is table 1, "main_chaotic" is table 2Use cases
- Register the one or many leaderboards your game submits scores to.
- Map readable table numbers (1, 2, 3) to panel table keys so the rest of your code never repeats the key strings.