Disparadores
Hay 35 disparadores, y cualquiera puede iniciar un evento. Los scripts oyen muchos de ellos con ctx.on(...), y los patches con sus nodos de evento. Key les llega como on-keydown y on-keyup, y Press on the object como on-mousedown, on-mouseup y on-click. Consulta La API de ctx.
Algunos disparadores tienen ramas, una para cada resultado. Cada rama tiene su propia lista de pasos, así que un solo evento puede cubrir todos los resultados. Consulta Eventos.
| En el editor | Categoría | Ramas | Id (para scripts y 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 |
Ajustes
Game controls
Id: on-game-control
Categoría control · ramas idle, move, jump, run
| Ajuste | Tipo | Por defecto | Opciones o etiqueta |
|---|---|---|---|
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
Categoría external
| Ajuste | Tipo | Por defecto | Opciones o etiqueta |
|---|---|---|---|
id | string | — | Action id |
Signal
Id: on-signal
Categoría external
| Ajuste | Tipo | Por defecto | Opciones o etiqueta |
|---|---|---|---|
signal | string | "" | Signal |
Variable change
Id: on-variable-change
Categoría external
| Ajuste | Tipo | Por defecto | Opciones o etiqueta |
|---|---|---|---|
variable | string | "" | Variable |
Hover out
Id: on-blur
Categoría input
Sin ajustes.
Click
Id: on-click
Categoría input
| Ajuste | Tipo | Por defecto | Opciones o etiqueta |
|---|---|---|---|
button | select | "any" | any, left, right, middle |
Double click
Id: on-double-click
Categoría input · alcance entity
| Ajuste | Tipo | Por defecto | Opciones o etiqueta |
|---|---|---|---|
button | select | "any" | any, left, right, middle |
Drag
Id: on-drag
Categoría input · alcance entity · solo en anclas surface
Sin ajustes.
Hover
Id: on-hover
Categoría input · ramas enter, exit · alcance entity
Sin ajustes.
Key
Id: on-key
Categoría input · ramas down, up
| Ajuste | Tipo | Por defecto | Opciones o etiqueta |
|---|---|---|---|
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
Categoría input · alcance entity
| Ajuste | Tipo | Por defecto | Opciones o etiqueta |
|---|---|---|---|
button | select | "any" | any, left, right, middle |
Press on the object
Id: on-mouse
Categoría input · ramas click, down, up · alcance entity
| Ajuste | Tipo | Por defecto | Opciones o etiqueta |
|---|---|---|---|
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
Categoría input · alcance entity · solo en anclas surface
Sin ajustes.
Pointer lock
Id: on-pointer-lock
Categoría input
Sin ajustes.
Cursor move
Id: on-pointer-move
Categoría input
Sin ajustes.
Rotate
Id: on-rotate
Categoría input · alcance entity · solo en anclas surface
Sin ajustes.
Scroll
Id: on-scroll
Categoría input
| Ajuste | Tipo | Por defecto | Opciones o etiqueta |
|---|---|---|---|
direction | select | "any" | any, up, down |
Launch
Id: on-launch
Categoría lifecycle
Sin ajustes.
Pause
Id: on-pause
Categoría lifecycle
Sin ajustes.
Resize
Id: on-resize
Categoría lifecycle
Sin ajustes.
Resume
Id: on-resume
Categoría lifecycle
Sin ajustes.
Visibility
Id: on-visibility
Categoría lifecycle · ramas show, hide
Sin ajustes.
Collision
Id: on-collide
Categoría physics
Sin ajustes.
Distance
Id: on-distance
Categoría proximity · ramas enter, exit
| Ajuste | Tipo | Por defecto | Opciones o etiqueta |
|---|---|---|---|
target | entity | null | Other object |
distance | number | 1 | Distance |
fireOnStart | boolean | false | Check at start |
State active
Id: on-state-active
Categoría state · se dispara para cada estado
Sin ajustes.
State inactive
Id: on-state-inactive
Categoría state · se dispara para cada estado
Sin ajustes.
Every N seconds
Id: on-interval
Categoría time
| Ajuste | Tipo | Por defecto | Opciones o etiqueta |
|---|---|---|---|
seconds | number | 1 | Every |
repeat | number | 0 | Repeat |
Delay
Id: on-timeout
Categoría time
| Ajuste | Tipo | Por defecto | Opciones o etiqueta |
|---|---|---|---|
seconds | number | 1 | After |
Detect
Id: on-detect
Categoría tracking · solo en anclas image, qr, face, body, surface
Sin ajustes.
Tracking lost
Id: on-lost
Categoría tracking · solo en anclas image, qr, face, body, surface
Sin ajustes.
Placed
Id: on-placed
Categoría tracking · solo en anclas surface
Sin ajustes.
VPS error
Id: on-vps-error
Categoría tracking · solo en anclas surface
Sin ajustes.
VPS localized
Id: on-vps-localized
Categoría tracking · solo en anclas surface
Sin ajustes.
VPS localization failed
Id: on-vps-not-localized
Categoría tracking · solo en anclas surface
Sin ajustes.
VPS ready
Id: on-vps-ready
Categoría tracking · solo en anclas surface
Sin ajustes.