UNPKG

hytopia

Version:

The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.

71 lines (33 loc) 969 B
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [client](./client.md) &gt; [HytopiaUI](./client.hytopiaui.md) &gt; [pressInput](./client.hytopiaui.pressinput.md) ## HytopiaUI.pressInput() method Simulates player input programmatically. Useful for creating custom UI controls that trigger game actions, such as for mobile UI buttons. **Signature:** ```typescript pressInput(input: string, pressed: boolean): void; ``` ## Parameters <table><thead><tr><th> Parameter </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td> input </td><td> string </td><td> Input name (e.g., 'forward', 'backward', 'left', 'right', 'jump', 'sprint') </td></tr> <tr><td> pressed </td><td> boolean </td><td> `true` to press and hold the input, `false` to release it </td></tr> </tbody></table> **Returns:** void