Référence des déclencheurs
35 déclencheurs. Les mêmes noms fonctionnent à trois endroits : le déclencheur d’un événement, le nœud d’événement d’un patch, et ctx.on(...) dans un script.
Un déclencheur avec des branches garde une liste d’étapes par issue, si bien qu’un seul événement répond à toutes — voir Événements.
| Dans l'éditeur | Catégorie | Branches | Id (scripts, patches) |
|---|---|---|---|
| Game controls | control | idle, move, jump, run | on-game-control |
| UI action | external | — | on-divkit-action |
| Signal | external | — | on-signal |
| Variable change | external | — | on-variable-change |
| Hover out | input | — | on-blur |
| Click | input | — | on-click |
| Double click | input | — | on-double-click |
| Drag | input | — | on-drag |
| Hover | input | enter, exit | on-hover |
| Key | input | down, up | on-key |
| Long press | input | — | on-long-press |
| Press on the object | input | click, down, up | on-mouse |
| Pinch | input | — | on-pinch |
| Pointer lock | input | — | on-pointer-lock |
| Cursor move | input | — | on-pointer-move |
| Rotate | input | — | on-rotate |
| Scroll | input | — | on-scroll |
| Launch | lifecycle | — | on-launch |
| Pause | lifecycle | — | on-pause |
| Resize | lifecycle | — | on-resize |
| Resume | lifecycle | — | on-resume |
| Visibility | lifecycle | show, hide | on-visibility |
| Collision | physics | — | on-collide |
| Distance | proximity | enter, exit | on-distance |
| State active | state | — | on-state-active |
| State inactive | state | — | on-state-inactive |
| Every N seconds | time | — | on-interval |
| Delay | time | — | on-timeout |
| Detect | tracking | — | on-detect |
| Tracking lost | tracking | — | on-lost |
| Placed | tracking | — | on-placed |
| VPS error | tracking | — | on-vps-error |
| VPS localized | tracking | — | on-vps-localized |
| VPS localization failed | tracking | — | on-vps-not-localized |
| VPS ready | tracking | — | on-vps-ready |
Paramètres
Game controls
Id: on-game-control
Catégorie control · branches idle, move, jump, run
| Paramètre | Type | Défaut | Options / libellé |
|---|---|---|---|
mode | select | "walk" | walk, fly, top_down |
turnToMove | boolean | true | Auto-orient |
towards | select | "camera" | camera, axis |
cameraRelative | boolean | true | Camera relative |
speed | number | 3 | Pos. Speed |
runMultiplier | number | 2 | Run Factor |
turnSpeed | number | 720 | Rot. Speed |
posDelayIn | number | 0 | Pos. Delay |
posDelayOut | number | 0 | |
rotDelayIn | number | 0 | Rot. Delay |
rotDelayOut | number | 0 | |
scheme | select | "both" | wasd, arrows, both |
rotateBy | select | "mouse" | mouse, keys, both |
touch | boolean | true | Touch controls |
touchRotateBy | select | "drag" | drag, joystick |
stickCorner | select | "bottom_left" | top_left, top_center, top_right, middle_left, middle_center, middle_right, bottom_left, bottom_center, bottom_right |
jumpCorner | select | "bottom_right" | top_left, top_center, top_right, middle_left, middle_center, middle_right, bottom_left, bottom_center, bottom_right |
touchOffsetX | number | 30 | Offset |
touchOffsetY | number | 30 | |
buttonSize | number | 120 | Button Size |
touchVisibility | select | "show" | show, hide |
colliderShape | select | "capsule" | capsule, sphere |
colliderRadius | number | 0.5 | Size |
colliderHeight | number | 1.8 | |
colliderX | number | 0 | Position |
colliderY | number | 0.9 | |
colliderZ | number | 0 | |
mass | number | 1 | Mass |
colliderHelper | select | "hide" | show, hide |
jumpHeight | number | 0 | Jump |
airControl | number | 0.3 | Air Control |
resetY | number | 0 | Rst Y-offset |
clickToMove | boolean | false | Click To Move |
followCamera | entity | null | Camera |
orientTo | select | "normal" | normal, angle |
camPosDelay | number | 0.12 | Pos. Delay |
camRotDelay | number | 0.08 | Rot. Delay |
upDown | select | "yes" | yes, no, limit |
upDownMin | number | 0 | Limit |
upDownMax | number | 89 | |
leftRight | select | "yes" | yes, no, limit |
leftRightMin | number | -90 | Limit |
leftRightMax | number | 90 |
UI action
Id: on-divkit-action
Catégorie external
| Paramètre | Type | Défaut | Options / libellé |
|---|---|---|---|
id | string | — | Action id |
Signal
Id: on-signal
Catégorie external
| Paramètre | Type | Défaut | Options / libellé |
|---|---|---|---|
signal | string | "" | Signal |
Variable change
Id: on-variable-change
Catégorie external
| Paramètre | Type | Défaut | Options / libellé |
|---|---|---|---|
variable | string | "" | Variable |
Hover out
Id: on-blur
Catégorie input
Aucun paramètre.
Click
Id: on-click
Catégorie input
| Paramètre | Type | Défaut | Options / libellé |
|---|---|---|---|
button | select | "any" | any, left, right, middle |
Double click
Id: on-double-click
Catégorie input · portée entity
| Paramètre | Type | Défaut | Options / libellé |
|---|---|---|---|
button | select | "any" | any, left, right, middle |
Drag
Id: on-drag
Catégorie input · portée entity · seulement sur les ancres surface
Aucun paramètre.
Hover
Id: on-hover
Catégorie input · branches enter, exit · portée entity
Aucun paramètre.
Key
Id: on-key
Catégorie input · branches down, up
| Paramètre | Type | Défaut | Options / libellé |
|---|---|---|---|
code | string | — | Code |
codes | array | [] | Keys |
ctrl | boolean | false | |
alt | boolean | false | |
shift | boolean | false | |
meta | boolean | false | |
double | boolean | false | Double press |
bind | string | "" | Project bind |
alts | array | [] | Alternatives |
ignoreRepeat | boolean | false | Ignore auto-repeat |
Long press
Id: on-long-press
Catégorie input · portée entity
| Paramètre | Type | Défaut | Options / libellé |
|---|---|---|---|
button | select | "any" | any, left, right, middle |
Press on the object
Id: on-mouse
Catégorie input · branches click, down, up · portée entity
| Paramètre | Type | Défaut | Options / libellé |
|---|---|---|---|
button | select | "any" | any, left, right, middle |
ctrl | boolean | false | |
alt | boolean | false | |
shift | boolean | false | |
meta | boolean | false | |
double | boolean | false | Double press |
bind | string | "" | Project bind |
alts | array | [] | Alternatives |
Pinch
Id: on-pinch
Catégorie input · portée entity · seulement sur les ancres surface
Aucun paramètre.
Pointer lock
Id: on-pointer-lock
Catégorie input
Aucun paramètre.
Cursor move
Id: on-pointer-move
Catégorie input
Aucun paramètre.
Rotate
Id: on-rotate
Catégorie input · portée entity · seulement sur les ancres surface
Aucun paramètre.
Scroll
Id: on-scroll
Catégorie input
| Paramètre | Type | Défaut | Options / libellé |
|---|---|---|---|
direction | select | "any" | any, up, down |
Launch
Id: on-launch
Catégorie lifecycle
Aucun paramètre.
Pause
Id: on-pause
Catégorie lifecycle
Aucun paramètre.
Resize
Id: on-resize
Catégorie lifecycle
Aucun paramètre.
Resume
Id: on-resume
Catégorie lifecycle
Aucun paramètre.
Visibility
Id: on-visibility
Catégorie lifecycle · branches show, hide
Aucun paramètre.
Collision
Id: on-collide
Catégorie physics
Aucun paramètre.
Distance
Id: on-distance
Catégorie proximity · branches enter, exit
| Paramètre | Type | Défaut | Options / libellé |
|---|---|---|---|
target | entity | null | Other object |
distance | number | 1 | Distance |
fireOnStart | boolean | false | Check at start |
State active
Id: on-state-active
Catégorie state · se déclenche par state
Aucun paramètre.
State inactive
Id: on-state-inactive
Catégorie state · se déclenche par state
Aucun paramètre.
Every N seconds
Id: on-interval
Catégorie time
| Paramètre | Type | Défaut | Options / libellé |
|---|---|---|---|
seconds | number | 1 | Every |
repeat | number | 0 | Repeat |
Delay
Id: on-timeout
Catégorie time
| Paramètre | Type | Défaut | Options / libellé |
|---|---|---|---|
seconds | number | 1 | After |
Detect
Id: on-detect
Catégorie tracking · seulement sur les ancres image, qr, face, surface
Aucun paramètre.
Tracking lost
Id: on-lost
Catégorie tracking · seulement sur les ancres image, qr, face, surface
Aucun paramètre.
Placed
Id: on-placed
Catégorie tracking · seulement sur les ancres surface
Aucun paramètre.
VPS error
Id: on-vps-error
Catégorie tracking · seulement sur les ancres surface
Aucun paramètre.
VPS localized
Id: on-vps-localized
Catégorie tracking · seulement sur les ancres surface
Aucun paramètre.
VPS localization failed
Id: on-vps-not-localized
Catégorie tracking · seulement sur les ancres surface
Aucun paramètre.
VPS ready
Id: on-vps-ready
Catégorie tracking · seulement sur les ancres surface
Aucun paramètre.