Table des matières

Language / Langue : FR | EN

Drag & Drop

Drag & drop lets the player take an element from the text and drop it onto a target. It is available on web, desktop and interactive HTML exports. Other adapters display the content without drag&drop interaction.

Sources and targets

text: "The {{door:$door}} is locked. The {{key:>key}} shines on the floor."

The syntax also works with pictures:

text: "Drop {{[[/scenarios/images/test/un.png]]:>token}} onto the {{slab:$slab}}."

Drop event

An event becomes a drag&drop pair when it contains source: and target:.

text: "The {{door:$door}} is locked. The {{key:>key}} shines on the floor."
interaction-ko: "Nothing interesting happens here."
events:
  - id: key_on_door
    source: key
    target: door
    do: "door_locked.=.0"
    text: "The door opens."
    text-ko: "This key does not open that door."
    once: true

Conditions

Showing roles

By default, sources and targets use a neutral style. To show roles visually, enable show-type: true at scenario level or only in a room.

show-type: true

rooms:
  - id: workshop
    show-type: true
    text: "{{hammer:>hammer}} / {{anvil:$anvil}}"

When a value is defined in a room, it overrides the global option for that room.

While dragging (or after a first tap on mobile), the interactive elements of the room are highlighted to show the possible targets.

Join us on Discord Make&Play