Skip to content

Latest commit

 

History

History
40 lines (37 loc) · 772 Bytes

basic-examples.md

File metadata and controls

40 lines (37 loc) · 772 Bytes

Basic Examples

Here are some basic examples of Love2D-ECS.

💡 Note: these examples are output-based templates from Love2D-ECS after compilation, but can be edited manually (not recommended).

SceneTemplate

{
  "sceneId": "MainMenu",
  "scenesObjects": [
    "ButtonPlay",
    "ButtonOption",
        "ButtonQuit",
  ]
}

GameObjectTemplate

{
  "gameObjectId": "ButtonPlay",
  "components": [
    {
      "componentId": "Transform",
      "data": {
        "position": { "x": "var_screen.width / 2 - self.width / 2"}
      }
    },
    {
      "componentId": "Text",
      "data": {
        "value": "Play"
      },
      "events": [
        { "eventId": "onClick", "action": "ft_changeScene('Game')"}
      ]
    }
  ]
}