hytopia
Version:
The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.
71 lines (33 loc) • 1.25 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [client](./client.md) > [HytopiaUI](./client.hytopiaui.md) > [registerSceneUITemplate](./client.hytopiaui.registersceneuitemplate.md)
## HytopiaUI.registerSceneUITemplate() method
Registers a custom Scene UI template that will instantiate when a SceneUI on the server for the given templateId is loaded. Templates define how your UI should render for each Scene UI instance created by the server.
**Signature:**
```typescript
registerSceneUITemplate(templateId: string, templateRenderer: TemplateRenderer): void;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
templateId
</td><td>
string
</td><td>
Unique identifier for this template (must match the templateId used server-side when creating a SceneUI)
</td></tr>
<tr><td>
templateRenderer
</td><td>
[TemplateRenderer](./client.templaterenderer.md)
</td><td>
Function that creates and returns the HTML element for this UI. This is effectively the factory function.
</td></tr>
</tbody></table>
**Returns:**
void