A component on a node
Set up a score display in JSON.
A component declares its node class: for example, BaseComponent<Text> with protected readonly nodeType = Text. Import Text from @gamedevland/engine/renderers/pixi. The SDK checks the type before calling the component hooks.
Add the score display to components. score names the component on this node, and type names the class registered with DI. layout.json
"components": {
"score": {
"type": "BlockPuzzleScoreComponent",
"data": { "popScale": 1.18, "popDuration": 0.2 }
}
}
onReadyThe layout is ready
onEnableSubscribe to events
onDisableUnsubscribe from events