Mobile Controls
RPGJS ships a CanvasEngine mobile overlay throughwithMobile(). It renders a
virtual joystick and action buttons over the game canvas, and forwards touches to
the same controls used by keyboard and gamepad input.
Enable Mobile Controls
AddwithMobile() to your client modules:
Configure the Overlay
Useenabled: "always" while testing from a desktop browser:
Customize Components
The default overlay is built with CanvasEngine components. You can replace the joystick, individual buttons, or both. Custom components receive the same control props as the default component plusdefaultProps, so they can wrap CanvasEngine
Joystick and Button without reimplementing RPGJS input behavior.
joystick or a button
option. For larger visual changes, prefer components and wrap the default
props inside your .ce component.
Runtime Behavior
Mobile controls are client-side input helpers. In standalone mode and MMORPG mode they send the same movement and action inputs as keyboard/gamepad controls; they do not create gameplay authority on the client. The virtual joystick uses CanvasEngine’sJoystick component for input. RPGJS
movement is cardinal, so diagonal joystick positions are resolved to the nearest
single RPGJS movement control before being repeated.