@cere/games-sdk-ui
v0.7.3
Published
Cere Games SDK UI Elements
Downloads
49
Readme
Cere Games SDK UI
Cere Games SDK UI
is an NPM package which provides a set of UI elements (Web Components) which can be used in a game.
This package is used by `@cere/games-sdk` and should not be used directly at the moment
Installation
Using NPM
:
npm install @cere/games-sdk-ui --save
Using yarn
:
yarn add @cere/games-sdk-ui
API
register()
Registers UI elements to be later used by Cere Games SDK
or inside game logic
import { register } from '@cere/games-sdk-u';
await register({...});
Parameters
context
- UI elements context created by createContext()
createContext()
Creates context object for register()
import { register, createContext } from '@cere/games-sdk-u';
const uiContext = createContext();
await register(uiContext);
uiContext.wallet.address = '0x0...'; // The UI is automatically updated with the new address