Every node in the Scene Editor gets the same Node and Transform properties along with some others. The node type pages only cover what's specific to each type; this page covers the rest.
Node
- Name: A plain label for the node, shown in the scene tree.
- Id: The identifier used to reach the node from code as
this.dom.<id>. A node isn't referenceable by default. Click the reference icon next to Id to start editing it (which makes it referenceable). - Visible: Shows or hides the node.
- User Select: when on, players can select the node's text and drag-select it. Turn it off to stop that.
Transform
- Position (x, y) and Size (w, h), each switchable between px and %. Size doesn't apply to Marker or Animator nodes, which have no visual box of their own.
- Rotation, in degrees.
- Scale (x, y).
- Skew (x, y), in degrees.
- Origin (x, y), as a percentage. This is what Rotation/Scale/Skew pivot around. Defaulting to 50/50 (dead center).
- Opacity (0-1) the alpha of the element and its children.
- Z-Index The draw order of the element compared to its siblings.
Events
A list of DOM event bindings and a handler name:
- click
- mouseenter
- mouseleave
- mousedown
- mouseup
- mousemove
- pointermove
- contextmenu
- scroll (on a scroll view, runs as it scrolls)
- focus
- blur
- keydown
- keyup.
The handler receives the DOM event, after any arguments you write in the handler name. The button next to the name adds the method to your scene script if it doesn't exist yet. In a TypeScript scene its parameters are typed for the event, such as onPointerMove(e: PointerEvent), and any arguments you wrote get parameters of their own, such as onClick(arg1: string, e: MouseEvent) for onClick("start").
The scene root has Events too. Normally the root lets clicks pass through it, but once it has an event it catches the pointer across the whole scene, so click or pointermove on the root fire over empty space as well. In a sub-scene the root still lets clicks pass through to the scene underneath, so its events only fire over the sub-scene's own elements.
mousemove runs each time the mouse moves over the node. pointermove does the same for the mouse, touch and pens. The event's clientX and clientY are in window pixels, and the game is scaled to fit the window, so convert them to get a position in your game's own coordinates, the same ones the Scene Editor uses:
onPointerMove(e) {
const game = document.getElementById("game");
const rect = game.getBoundingClientRect();
const x = (e.clientX - rect.left) * (game.offsetWidth / rect.width);
const y = (e.clientY - rect.top) * (game.offsetHeight / rect.height);
log(`Pointer at ${Math.round(x)}, ${Math.round(y)}`);
},
CSS
Free-form custom CSS declarations on the node, plus a collapsible "Advanced" section. This is separate from the Styles Manager's named styles.
Animations
This is a list of all animations listen in the scene that can be accessed by the element CSS or State's CSS
States
A repeatable list of named CSS-variant states (see setState() in Coding and Scene Editor), each with its own CSS rules. A "Preview state" bar appears at the top of the inspector once a node has any states defined, so you can preview with a click.