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.
| Constant | Value | Description |
|---|
NONE | 0 | No easing (instant/linear) |
EASE_IN_OUT | 1 | Smooth acceleration and deceleration |
EASE_IN | 2 | Accelerate from zero speed |
EASE_OUT | 3 | Decelerate to zero speed |
ELASTIC_IN_OUT | 4 | Spring-like elastic in and out |
ELASTIC_IN | 5 | Spring-like elastic in |
ELASTIC_OUT | 6 | Spring-like elastic out |
BOUNCE_IN_OUT | 7 | Bouncing in and out |
BOUNCE_IN | 8 | Bouncing in |
BOUNCE_OUT | 9 | Bouncing out |
EXPONENTIAL_IN_OUT | 10 | Exponential acceleration and deceleration |
EXPONENTIAL_IN | 11 | Exponential acceleration |
EXPONENTIAL_OUT | 12 | Exponential deceleration |
SINE_IN_OUT | 13 | Sinusoidal in and out |
SINE_IN | 14 | Sinusoidal in |
SINE_OUT | 15 | Sinusoidal out |
BACK_IN_OUT | 16 | Overshoot in and out |
BACK_IN | 17 | Overshoot in |
BACK_OUT | 18 | Overshoot out |
Comparison Operators
Used with Counter.if_is and while_loop condition objects.
| Constant | Value | Meaning |
|---|
EQUAL_TO | 0 | counter == other |
LARGER_THAN | 1 | counter > other |
SMALLER_THAN | 2 | counter < other |
Item Operators
Assignment Operators (assign_op in item_edit)
| Constant | Value | Operation |
|---|
EQ | 0 | target = expression |
ADD | 1 | target += expression |
SUB | 2 | target -= expression |
MUL | 3 | target *= expression |
DIV | 4 | target /= expression |
Comparison Operators (compare_op in item_comp)
| Constant | Value | Condition |
|---|
GREATER | 1 | item1 > item2 |
GREATER_OR_EQ | 2 | item1 >= item2 |
LESS | 3 | item1 < item2 |
LESS_OR_EQ | 4 | item1 <= item2 |
NOT_EQ | 5 | item1 ≠ item2 |
Abs / Neg Flags (absn1, absn2)
| Constant | Value | Effect |
|---|
ABS | 1 | Take the absolute value |
NEG | 2 | Negate the value |
Round / Floor / Ceil Flags (rfc1, rfc2)
| Constant | Value | Effect |
|---|
RND | 1 | Round to nearest integer |
FLR | 2 | Floor to nearest integer below |
CEI | 3 | Ceil to nearest integer above |
Item Types
Used with the type1, type2, and targ_type parameters in item_edit and item_comp.
| Constant | Value | Refers to |
|---|
ITEM | 1 | Standard pickup / counter item |
TIMER | 2 | Timer item |
POINTS | 3 | Points / score |
TIME | 4 | Level elapsed time |
ATTEMPT | 5 | Current attempt number |
Sequence Modes
Used with the mode parameter in sequence().
| Constant | Value | Behaviour |
|---|
MODE_STOP | 0 | Stop after the last entry |
MODE_LOOP | 1 | Loop back to the first entry |
MODE_LAST | 2 | Keep calling the last entry indefinitely |
Camera Edge Constants
Used with camera_edge() to specify which screen edge to pin to a target object.
| Constant | Value | Edge |
|---|
LEFT_EDGE | 1 | Left edge of the screen |
RIGHT_EDGE | 2 | Right edge of the screen |
UP_EDGE | 3 | Top edge of the screen |
DOWN_EDGE | 4 | Bottom 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).
| Constant | Channel | Description |
|---|
BG | Background | Level background color |
GROUND | Ground | Primary ground color |
LINE | Line | Object outline color |
_3DLINE | 3D Line | 3D object edge color |
OBJECT | Object | Default object color |
GROUND2 | Ground 2 | Secondary ground color |
BLACK | Black | Pure black |
WHITE | White | Pure white |
LIGHTER | Lighter | Lighter variant of a color |
MIDDLEGROUND | Middleground | Primary middleground color |
MIDDLEGROUND_2 | Middleground 2 | Secondary 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.