Preskoči na vsebino

std-game-hud

Level: Atom | Entity: GameHud | Persistence: runtime

1 states, 2 events, 2 transitions

Live Preview

schema.orb
{
"name": "GameHudOrbital",
"orbitals": [
{
"name": "GameHudOrbital",
"entity": {
"name": "GameHud",
"persistence": "runtime",
"fields": [
{
"name": "id",
"type": "string"
},
{
"name": "name",
"type": "string"
},
{
"name": "description",
"type": "string"
},
{
"name": "status",
"type": "string",
"default": "active",
"values": [
"active",
"inactive",
"pending"
]
},
{
"name": "createdAt",
"type": "string"
}
]
},
"traits": [
{
"name": "GameHudHud",
"linkedEntity": "GameHud",
"category": "interaction",
"stateMachine": {
"states": [
{
"name": "idle",
"isInitial": true
}
],
"events": [
{
"key": "INIT",
"name": "Initialize"
},
{
"key": "REFRESH",
"name": "Refresh"
}
],
"transitions": [
{
"from": "idle",
"to": "idle",
"event": "INIT",
"effects": [
[
"fetch",
"GameHud"
],
[
"render-ui",
"main",
{
"type": "game-hud",
"position": "top-left",
"size": "md",
"transparent": false,
"stats": [
{
"label": "Name",
"value": "@entity.name"
},
{
"label": "Description",
"value": "@entity.description"
},
{
"label": "Status",
"value": "@entity.status"
},
{
"label": "CreatedAt",
"value": "@entity.createdAt"
}
]
}
]
]
},
{
"from": "idle",
"to": "idle",
"event": "REFRESH",
"effects": [
[
"fetch",
"GameHud"
],
[
"render-ui",
"main",
{
"type": "game-hud",
"position": "top-left",
"size": "md",
"transparent": false,
"stats": [
{
"label": "Name",
"value": "@entity.name"
},
{
"label": "Description",
"value": "@entity.description"
},
{
"label": "Status",
"value": "@entity.status"
},
{
"label": "CreatedAt",
"value": "@entity.createdAt"
}
]
}
]
]
}
]
}
}
],
"pages": [
{
"name": "GameHudHudPage",
"path": "/gamehuds",
"traits": [
{
"ref": "GameHudHud"
}
]
}
]
}
],
"description": "Heads-up display atom. Renders the `game-hud` pattern showing health, score, lives, and other stats."
}
Loading preview...

Orbital Visualization

Loading visualization...

Entity Fields

FieldTypeDefault
idstring-
namestring-
descriptionstring-
statusstring"active"
createdAtstring-

States

StateType
idleInitial

Events

EventPayload
INIT-
REFRESH-

Transitions

FromEventToEffects
idleINITidle2 effects
idleREFRESHidle2 effects