Mouse and touch
In Assemble3 the mouse and screen touches work together: the same event serves computers and phones.
Click or tap an object
| Conditions | Actions |
|---|---|
Mouse: Mouse button pressed or touch held Left and Box Cursor/touch is on an object |
Box Delete |
The first condition asks "is the button down?". The second asks "is the cursor over this object?". Together: "the box was clicked".
Note: Mouse button pressed stays true while the button is down. To count a click only once, use the released condition or the run-once condition.
Follow the cursor
| Conditions | Actions |
|---|---|
| (none) | Crosshair Position X: MouseX(), Y: MouseY() |
MouseX() and MouseY() give the position of the cursor (or touch) on screen.
Multi-finger touch
The Touch conditions, such as A new touch started, and the TouchX(id) and TouchY(id) expressions treat each finger separately. Use the joystick and buttons of the Platformer example's Mobile Controls as a starting point.
Dragging objects
Without writing events, add the Drag & Drop behavior to the object.