Every visible thing and every interaction in a Geometry Dash level is an object. G.js represents objects as plain dictionaries keyed by theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/g-js-api/G.js/llms.txt
Use this file to discover all available pages before exploring further.
obj_props property name constants, and exposes two factory functions — object() for static or decorative objects and trigger() for game-logic triggers. Both return a GJsObject that you can chain property setters on before calling .add() to place the object into the level.
object(dict)
Creates a GD level object from a property dictionary and returns a chainable GJsObject.
A plain object whose keys are
obj_props constants (or their raw numeric equivalents) and whose values are the corresponding property values.GJsObject
trigger(dict)
Creates a GD trigger object. Functionally identical to object() but semantically marks the result as a trigger, which affects how G.js positions it in the level when auto-positioning is enabled.
Property dictionary. The same
obj_props keys apply as for object().GJsObject
GJsObject
The interface returned by both object() and trigger().
Always
'object'. Can be used to identify G.js object values at runtime.The raw property dictionary passed to the factory function, including any properties added via
.with()..with(prop, value)
Returns a new GJsObject with prop set to value. Chainable — call as many times as needed before .add().
The property to set. Use an
obj_props constant for readability.The value to assign to the property.
GJsObject
.add()
Places the object into the current level context. Must be called when you are done setting properties.
Returns void
String .to_obj()
G.js extends the native String prototype with a .to_obj() helper that converts a string value into a GD text object. The resulting GJsObject can be chained with .with() and finished with .add() exactly like any other object.
obj_props
The obj_props dictionary maps human-readable property names to their GD numeric IDs. Always prefer these constants over raw numbers for maintainability.
The full list of properties is also documented at /api/obj-props.
| Constant | Description |
|---|---|
OBJ_ID | Geometry Dash object/trigger ID |
X | X position |
Y | Y position |
GROUPS | Group(s) assigned to the object |
ROTATION | Rotation in degrees |
COLOR | Primary color channel |
COLOR_2 | Secondary color channel |
Z_LAYER | Z layer (rendering order layer) |
Z_ORDER | Z order within the layer |
SCALING | Object scale |
OPACITY | Object opacity (0–1) |
TEXT | Text content (text objects) |
SPAWN_TRIGGERED | Whether the trigger is spawn-triggered |
obj_ids
obj_ids is a dictionary of well-known GD object IDs indexed by descriptive name. Use it when you know the conceptual object you want but do not want to hard-code a magic number.
levelstring_to_obj(string)
Parses a raw GD levelstring and returns an array of property dictionaries. Type conversions are not performed automatically — all values remain strings as they appear in the levelstring.
A valid GD levelstring.
Dictionary[]
obj_to_levelstring(object)
Converts a single property dictionary (or GJsObject) back into a GD levelstring fragment.
The property dictionary to serialise.
string