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.

G.js exports a set of named constants to replace magic numbers in trigger configurations. All constants can be imported directly from geometry-dash-gjs. This page lists every constant grouped by category.
import {
  EASE_IN_OUT, EQUAL_TO,
  ITEM, TIMER,
  BG, GROUND,
  MODE_LOOP,
  LEFT_EDGE
} from 'geometry-dash-gjs';

Easing Constants

Used wherever an easing parameter appears — move triggers, camera functions, keyframes, and more.
ConstantValueDescription
NONE0No easing (instant/linear)
EASE_IN_OUT1Smooth acceleration and deceleration
EASE_IN2Accelerate from zero speed
EASE_OUT3Decelerate to zero speed
ELASTIC_IN_OUT4Spring-like elastic in and out
ELASTIC_IN5Spring-like elastic in
ELASTIC_OUT6Spring-like elastic out
BOUNCE_IN_OUT7Bouncing in and out
BOUNCE_IN8Bouncing in
BOUNCE_OUT9Bouncing out
EXPONENTIAL_IN_OUT10Exponential acceleration and deceleration
EXPONENTIAL_IN11Exponential acceleration
EXPONENTIAL_OUT12Exponential deceleration
SINE_IN_OUT13Sinusoidal in and out
SINE_IN14Sinusoidal in
SINE_OUT15Sinusoidal out
BACK_IN_OUT16Overshoot in and out
BACK_IN17Overshoot in
BACK_OUT18Overshoot out

Comparison Operators

Used with Counter.if_is and while_loop condition objects.
ConstantValueMeaning
EQUAL_TO0counter == other
LARGER_THAN1counter > other
SMALLER_THAN2counter < other

Item Operators

Assignment Operators (assign_op in item_edit)

ConstantValueOperation
EQ0target = expression
ADD1target += expression
SUB2target -= expression
MUL3target *= expression
DIV4target /= expression

Comparison Operators (compare_op in item_comp)

ConstantValueCondition
GREATER1item1 > item2
GREATER_OR_EQ2item1 >= item2
LESS3item1 < item2
LESS_OR_EQ4item1 <= item2
NOT_EQ5item1 ≠ item2

Abs / Neg Flags (absn1, absn2)

ConstantValueEffect
ABS1Take the absolute value
NEG2Negate the value

Round / Floor / Ceil Flags (rfc1, rfc2)

ConstantValueEffect
RND1Round to nearest integer
FLR2Floor to nearest integer below
CEI3Ceil to nearest integer above

Item Types

Used with the type1, type2, and targ_type parameters in item_edit and item_comp.
ConstantValueRefers to
ITEM1Standard pickup / counter item
TIMER2Timer item
POINTS3Points / score
TIME4Level elapsed time
ATTEMPT5Current attempt number

Sequence Modes

Used with the mode parameter in sequence().
ConstantValueBehaviour
MODE_STOP0Stop after the last entry
MODE_LOOP1Loop back to the first entry
MODE_LAST2Keep calling the last entry indefinitely

Camera Edge Constants

Used with camera_edge() to specify which screen edge to pin to a target object.
ConstantValueEdge
LEFT_EDGE1Left edge of the screen
RIGHT_EDGE2Right edge of the screen
UP_EDGE3Top edge of the screen
DOWN_EDGE4Bottom edge of the screen

Color Channel Constants

Pre-defined $color objects for GD’s named color channels. Pass these wherever a channel argument is expected (e.g. color_trigger).
ConstantChannelDescription
BGBackgroundLevel background color
GROUNDGroundPrimary ground color
LINELineObject outline color
_3DLINE3D Line3D object edge color
OBJECTObjectDefault object color
GROUND2Ground 2Secondary ground color
BLACKBlackPure black
WHITEWhitePure white
LIGHTERLighterLighter variant of a color
MIDDLEGROUNDMiddlegroundPrimary middleground color
MIDDLEGROUND_2Middleground 2Secondary middleground color
import { color_trigger, BG, GROUND } from 'geometry-dash-gjs';

color_trigger(BG, 20, 20, 40, 2).add();      // dark blue background
color_trigger(GROUND, 60, 60, 80, 2).add();   // slightly lighter ground
Color channel constants are typed as $color objects, not raw numbers. Pass them directly to color_trigger and similar functions.

Build docs developers (and LLMs) love