Skip to main content

Documentation 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 is a dictionary that maps human-readable property name strings to GD’s internal numeric property IDs. It is primarily used with the object() and trigger() core functions to build object configuration dictionaries in a readable way, without memorising raw numeric IDs.

How to Use

Import obj_props and use bracket notation to reference properties as computed keys:
import { object, obj_props } from 'geometry-dash-gjs';

object({
  [obj_props.OBJ_ID]: 1,
  [obj_props.X]: 75,
  [obj_props.Y]: 105,
  [obj_props.GROUPS]: [group(1), group(2)],
}).add();
You can also destructure the properties you need:
const { OBJ_ID, X, Y, DURATION, TARGET } = obj_props;

trigger({
  [OBJ_ID]: 901,
  [X]: 300,
  [Y]: 200,
  [DURATION]: 1.5,
  [TARGET]: group(5),
}).add();
Always use bracket notation [obj_props.X] as a computed key when building object dictionaries. Plain string keys like "X" will not be recognised by GD’s internal parser.

Position & Transform

Properties that control where an object sits in the level and how it is oriented.
PropertyDescription
OBJ_IDObject ID — determines which GD object is placed
XX position in GD units
YY position in GD units
ROTATIONRotation in degrees
SCALINGUniform scale factor
HORIZONTAL_FLIPMirror the object horizontally
VERTICAL_FLIPMirror the object vertically

Groups & Colors

Properties for assigning groups and color channels.
PropertyDescription
GROUPSArray of group IDs the object belongs to
COLORPrimary color channel (channel 1)
COLOR_2Secondary color channel (channel 2)
TARGET_COLORTarget color channel used by color triggers
GROUP_PARENTMarks the object as a group parent
HVSHSV string for color channel 1
COLOR_2_HVSHSV string for color channel 2
HVS_ENABLEDEnable custom HSV for channel 1
COLOR_2_HVS_ENABLEDEnable custom HSV for channel 2

Trigger Properties

Properties that apply specifically to trigger objects.
PropertyDescription
DURATIONDuration of the trigger’s effect in seconds
TOUCH_TRIGGEREDTrigger activates on player touch
SPAWN_TRIGGEREDTrigger activates on spawn (via spawn trigger)
SPAWN_DURATIONDelay between spawned trigger activation
ACTIVE_TRIGGERMarks trigger as active from the start

Visual

Properties that control rendering and layer ordering.
PropertyDescription
OPACITYObject opacity (0 = invisible, 1 = fully visible)
BLENDINGEnable additive blending
Z_LAYERZ-layer for depth sorting
Z_ORDERZ-order within the Z-layer
EDITOR_LAYER_1Editor display layer 1
EDITOR_LAYER_2Editor display layer 2
DONT_FADEPrevent the object from fading in/out
DONT_ENTERPrevent the object from entering with the camera

Pulse / Color Effects

Properties for pulse trigger configuration and copied color effects.
PropertyDescription
FADE_INFade-in time for pulse
HOLDHold time for pulse
FADE_OUTFade-out time for pulse
PULSE_HSVUse HSV mode for pulse
COPIED_COLOR_IDSource channel to copy color from
COPIED_COLOR_HVSHSV offset for the copied color
COPY_OPACITYCopy opacity from the source channel
PLAYER_COLOR_1Use Player 1’s color
PLAYER_COLOR_2Use Player 2’s color
MAIN_ONLYApply effect to main color only
DETAIL_ONLYApply effect to detail color only

Move / Rotate

Properties used by move and rotate triggers.
PropertyDescription
MOVE_XHorizontal displacement in GD units
MOVE_YVertical displacement in GD units
ROTATE_DEGREESDegrees to rotate the target
LOCK_TO_PLAYER_XLock the object’s X axis to the player
LOCK_TO_PLAYER_YLock the object’s Y axis to the player

Spawn / Target

Properties for targeting groups and controlling activation.
PropertyDescription
TARGETGroup ID of the trigger’s target
TARGET_TYPEType of the target (group / color / etc.)
YELLOW_TELEPORTATION_PORTAL_DISTANCEDistance offset for yellow teleport portals
ACTIVATE_GROUPActivate the target group on trigger

Text

PropertyDescription
TEXTText string for text objects (base64-encoded in GD)

Trigger Colors

RGB color values used directly on trigger objects.
PropertyDescription
TRIGGER_REDRed component (0–255)
TRIGGER_GREENGreen component (0–255)
TRIGGER_BLUEBlue component (0–255)

Miscellaneous

PropertyDescription
PORTAL_CHECKEDWhether a portal has been validated by the editor

Additional Properties

obj_props contains many more properties used by specific trigger and object types. The full set covers advanced follow triggers, song editing, SFX, particle systems, item triggers, and more. A non-exhaustive selection of commonly accessed additional properties:
PropertyDescription
EASINGEasing type for move/rotate/scale triggers
EASING_RATEEasing rate modifier
ITEMItem ID used by pickup and count triggers
COUNTCount value for count triggers
SPEEDSpeed modifier
DELAYDelay in seconds
INTERVALMinimum trigger interval
MULTI_TRIGGERAllow the trigger to fire multiple times
COMPARISONComparison type for instant count triggers
DUAL_MODEEnable dual-player mode
ZOOMCamera zoom amount
SONG_IDSong ID for song triggers
SONG_VOLUMESong volume (0–1)
SONG_SPEEDSong speed modifier
SONG_LOOPLoop the song
SONG_CHANNELAudio channel for the song
PARTICLE_DATASerialised particle properties string
GRAVITYGravity magnitude for gravity triggers
SEQUENCESequence data string
MODESequence mode (stop / loop / last)
REMAPSRemap data for remappable trigger functions
TYPE_1Item type 1 for item edit/compare
TYPE_2Item type 2 for item edit/compare
ASSIGN_OPAssignment operator for item edit
COMP_OPComparison operator for item compare
MODModifier scalar for item expressions
ABSNEG_1Abs/neg flag for first item operand
ABSNEG_2Abs/neg flag for second item operand
RFC_1Round/floor/ceil flag for first operand
RFC_2Round/floor/ceil flag for second operand
When exploring unfamiliar trigger types, check which properties they expose in the GD editor and look up the corresponding obj_props key in the full type declaration at properties/obj_props.d.ts.

Build docs developers (and LLMs) love