UNPKG

hytopia

Version:

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

133 lines (61 loc) 2.11 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [server](./server.md) &gt; [PlayerUI](./server.playerui.md) ## PlayerUI class The UI for a player. **Signature:** ```typescript export default class PlayerUI extends EventRouter ``` **Extends:** [EventRouter](./server.eventrouter.md) ## Remarks UI allows control of all in-game overlays a player sees. UI is controlled by HTML, CSS and JavaScript files you provide in your `assets` folder. <h2>Events</h2> This class is an EventRouter, and instances of it emit events with payloads listed under [PlayerUIEventPayloads](./server.playeruieventpayloads.md) The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `PlayerUI` class. ## Properties <table><thead><tr><th> Property </th><th> Modifiers </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td> [player](./server.playerui.player.md) </td><td> `readonly` </td><td> [Player](./server.player.md) </td><td> The player that the UI belongs to. </td></tr> </tbody></table> ## Methods <table><thead><tr><th> Method </th><th> Modifiers </th><th> Description </th></tr></thead> <tbody><tr><td> [load(htmlUri)](./server.playerui.load.md) </td><td> </td><td> Loads client UI for the player. </td></tr> <tr><td> [lockPointer(lock)](./server.playerui.lockpointer.md) </td><td> </td><td> Locks or unlocks the player's mouse pointer. If the pointer is unlocked with lockPointer(false), the player will not be able to use in-game inputs or camera controls from the mouse pointer until `player.ui.lockPointer(true)`<!-- -->, or in your game's client UI html with `hytopia.lockPointer(true)`<!-- -->. </td></tr> <tr><td> [sendData(data)](./server.playerui.senddata.md) </td><td> </td><td> Sends data to the player's client UI. </td></tr> </tbody></table>