Selectable
Something the player selects as in a strategy game, with a SelectionControls: a worker, a machine, a truck. A click picks it, a box dragged over it picks it (with InBox), a double-click picks every one of its Kind on screen, and right-clicking it while others are selected commands them, with it as the target. A marker is drawn round it while it’s selected.
Its area is Size if that’s set, else its Button’s, else its box collider’s or its sprite’s. Where several overlap under the mouse, the one drawn on top is picked.
Works with: SelectionControls (selects it)
Properties
Section titled “Properties”Each is listed as its key in the scene file and the MCP tools, then its kind of value, its default and what it does.
kind: text = null. What kind of thing it is, e.g. “Worker” or “Smelter”: a double-click on it picks every one of this kind on screen. Empty goes by the entity’s name. (Names a selectable kind: this entity’s own, which other fields can name.) (Field: a name.)inBox: true or false = true. Whether a box dragged out over it picks it. Untick it for what’s picked one at a time (a machine, a storage stack) so a box picks only the workers among them. (Field: on or off.)clickable: true or false = true. Whether a click picks it. Untick it for something that’s only a target: right-clicking it still commands what’s selected, with it as the target (a resource, an enemy). (Field: on or off.)size: [x, y] = [0,0]. The area that picks it, in world units before the transform’s scale (and turned with it), centered on the entity plus Offset. (0, 0) takes its Button’s, box collider’s or sprite’s. (A rectangle’s size, around the entity, in its own units before its scale: with Resize handles the Scene view puts handles on its edges and corners to drag.) (Field: a vector.)offset: [x, y] = [0,0]. Where the middle of Size’s area is from the entity, e.g. (0, 0.5) for a character standing on its position. (Field: a vector.)
While the game runs
Section titled “While the game runs”Not saved with the scene; scripts read them, and entity_get shows them as live while the game plays.
isSelected: true or false. True while a SelectionControls has it selected.kindName: text. Its kind for a double-click: Kind, or else the entity’s name.
Scripts use it as Selectable: its methods, events and values that aren’t saved with the scene.