Aller au contenu principal

Déclencheurs

Il existe 35 déclencheurs, et chacun peut lancer un événement. Les scripts en entendent beaucoup via ctx.on(...), et les patchs via leurs nœuds d’événement. Key y arrive sous les noms on-keydown et on-keyup, et Press on the object sous on-mousedown, on-mouseup et on-click. Voir L’API ctx.

Certains déclencheurs ont des branches, une pour chaque issue. Chaque branche a sa propre liste d’étapes : un seul événement peut ainsi gérer toutes les issues. Voir Événements.

Dans l’éditeurCatégorieBranchesId (pour les scripts et les patches)
Game controlscontrolidle, move, jump, runon-game-control
UI actionexternal—on-divkit-action
Signalexternal—on-signal
Variable changeexternal—on-variable-change
Hover outinput—on-blur
Clickinput—on-click
Double clickinput—on-double-click
Draginput—on-drag
Hoverinputenter, exiton-hover
Keyinputdown, upon-key
Long pressinput—on-long-press
Press on the objectinputclick, down, upon-mouse
Pinchinput—on-pinch
Pointer lockinput—on-pointer-lock
Cursor moveinput—on-pointer-move
Rotateinput—on-rotate
Scrollinput—on-scroll
Launchlifecycle—on-launch
Pauselifecycle—on-pause
Resizelifecycle—on-resize
Resumelifecycle—on-resume
Visibilitylifecycleshow, hideon-visibility
Collisionphysics—on-collide
Distanceproximityenter, exiton-distance
State activestate—on-state-active
State inactivestate—on-state-inactive
Every N secondstime—on-interval
Delaytime—on-timeout
Detecttracking—on-detect
Tracking losttracking—on-lost
Placedtracking—on-placed
VPS errortracking—on-vps-error
VPS localizedtracking—on-vps-localized
VPS localization failedtracking—on-vps-not-localized
VPS readytracking—on-vps-ready

Réglages​

Game controls​

Id: on-game-control

Catégorie control · branches idle, move, jump, run

RéglageTypePar défautOptions ou libellé
modeselect"walk"walk, fly, top_down
turnToMovebooleantrueAuto-orient
towardsselect"camera"camera, axis
cameraRelativebooleantrueCamera relative
speednumber3Pos. Speed
runMultipliernumber2Run Factor
turnSpeednumber720Rot. Speed
posDelayInnumber0Pos. Delay
posDelayOutnumber0
rotDelayInnumber0Rot. Delay
rotDelayOutnumber0
schemeselect"both"wasd, arrows, both
rotateByselect"mouse"mouse, keys, both
touchbooleantrueTouch controls
touchRotateByselect"drag"drag, joystick
stickCornerselect"bottom_left"top_left, top_center, top_right, middle_left, middle_center, middle_right, bottom_left, bottom_center, bottom_right
jumpCornerselect"bottom_right"top_left, top_center, top_right, middle_left, middle_center, middle_right, bottom_left, bottom_center, bottom_right
touchOffsetXnumber30Offset
touchOffsetYnumber30
buttonSizenumber120Button Size
touchVisibilityselect"show"show, hide
colliderShapeselect"capsule"capsule, sphere
colliderRadiusnumber0.5Size
colliderHeightnumber1.8
colliderXnumber0Position
colliderYnumber0.9
colliderZnumber0
massnumber1Mass
colliderHelperselect"hide"show, hide
jumpHeightnumber0Jump
airControlnumber0.3Air Control
resetYnumber0Rst Y-offset
clickToMovebooleanfalseClick To Move
followCameraentitynullCamera
orientToselect"normal"normal, angle
camPosDelaynumber0.12Pos. Delay
camRotDelaynumber0.08Rot. Delay
upDownselect"yes"yes, no, limit
upDownMinnumber0Limit
upDownMaxnumber89
leftRightselect"yes"yes, no, limit
leftRightMinnumber-90Limit
leftRightMaxnumber90

UI action​

Id: on-divkit-action

Catégorie external

RéglageTypePar défautOptions ou libellé
idstring—Action id

Signal​

Id: on-signal

Catégorie external

RéglageTypePar défautOptions ou libellé
signalstring""Signal

Variable change​

Id: on-variable-change

Catégorie external

RéglageTypePar défautOptions ou libellé
variablestring""Variable

Hover out​

Id: on-blur

Catégorie input

Aucun réglage.

Click​

Id: on-click

Catégorie input

RéglageTypePar défautOptions ou libellé
buttonselect"any"any, left, right, middle

Double click​

Id: on-double-click

Catégorie input · portée entity

RéglageTypePar défautOptions ou libellé
buttonselect"any"any, left, right, middle

Drag​

Id: on-drag

Catégorie input · portée entity · seulement sur les ancres surface

Aucun réglage.

Hover​

Id: on-hover

Catégorie input · branches enter, exit · portée entity

Aucun réglage.

Key​

Id: on-key

Catégorie input · branches down, up

RéglageTypePar défautOptions ou libellé
codestring—Code
codesarray[]Keys
ctrlbooleanfalse
altbooleanfalse
shiftbooleanfalse
metabooleanfalse
doublebooleanfalseDouble press
bindstring""Project bind
altsarray[]Alternatives
ignoreRepeatbooleanfalseIgnore auto-repeat

Long press​

Id: on-long-press

Catégorie input · portée entity

RéglageTypePar défautOptions ou libellé
buttonselect"any"any, left, right, middle

Press on the object​

Id: on-mouse

Catégorie input · branches click, down, up · portée entity

RéglageTypePar défautOptions ou libellé
buttonselect"any"any, left, right, middle
ctrlbooleanfalse
altbooleanfalse
shiftbooleanfalse
metabooleanfalse
doublebooleanfalseDouble press
bindstring""Project bind
altsarray[]Alternatives

Pinch​

Id: on-pinch

Catégorie input · portée entity · seulement sur les ancres surface

Aucun réglage.

Pointer lock​

Id: on-pointer-lock

Catégorie input

Aucun réglage.

Cursor move​

Id: on-pointer-move

Catégorie input

Aucun réglage.

Rotate​

Id: on-rotate

Catégorie input · portée entity · seulement sur les ancres surface

Aucun réglage.

Scroll​

Id: on-scroll

Catégorie input

RéglageTypePar défautOptions ou libellé
directionselect"any"any, up, down

Launch​

Id: on-launch

Catégorie lifecycle

Aucun réglage.

Pause​

Id: on-pause

Catégorie lifecycle

Aucun réglage.

Resize​

Id: on-resize

Catégorie lifecycle

Aucun réglage.

Resume​

Id: on-resume

Catégorie lifecycle

Aucun réglage.

Visibility​

Id: on-visibility

Catégorie lifecycle · branches show, hide

Aucun réglage.

Collision​

Id: on-collide

Catégorie physics

Aucun réglage.

Distance​

Id: on-distance

Catégorie proximity · branches enter, exit

RéglageTypePar défautOptions ou libellé
targetentitynullOther object
distancenumber1Distance
fireOnStartbooleanfalseCheck at start

State active​

Id: on-state-active

Catégorie state · se déclenche pour chaque état

Aucun réglage.

State inactive​

Id: on-state-inactive

Catégorie state · se déclenche pour chaque état

Aucun réglage.

Every N seconds​

Id: on-interval

Catégorie time

RéglageTypePar défautOptions ou libellé
secondsnumber1Every
repeatnumber0Repeat

Delay​

Id: on-timeout

Catégorie time

RéglageTypePar défautOptions ou libellé
secondsnumber1After

Detect​

Id: on-detect

Catégorie tracking · seulement sur les ancres image, qr, face, body, surface

Aucun réglage.

Tracking lost​

Id: on-lost

Catégorie tracking · seulement sur les ancres image, qr, face, body, surface

Aucun réglage.

Placed​

Id: on-placed

Catégorie tracking · seulement sur les ancres surface

Aucun réglage.

VPS error​

Id: on-vps-error

Catégorie tracking · seulement sur les ancres surface

Aucun réglage.

VPS localized​

Id: on-vps-localized

Catégorie tracking · seulement sur les ancres surface

Aucun réglage.

VPS localization failed​

Id: on-vps-not-localized

Catégorie tracking · seulement sur les ancres surface

Aucun réglage.

VPS ready​

Id: on-vps-ready

Catégorie tracking · seulement sur les ancres surface

Aucun réglage.