Skip to content

Commit

Permalink
bump readme
Browse files Browse the repository at this point in the history
  • Loading branch information
PadraigK committed Oct 14, 2023
1 parent a6fe155 commit b57e157
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Binary file removed Images/node-tree.png
Binary file not shown.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SceneGen

Renders typed descriptions of each node in the scene files (.tscn) of a Godot project. Provides an access function to get a reference to the nodes called `node()`. This tool is intended for use with Miguel de Icaza's SwiftGodot bindings and generates Swift code that depends on SwiftGodot being available.
Renders typed descriptions of each node in the scene files (.tscn) of a Godot project. Provides an access function to get a reference to the nodes called `node()`. This tool is intended for use with Miguel de Icaza's [SwiftGodot](https://github.com/migueldeicaza/SwiftGodot) bindings and generates Swift code that depends on SwiftGodot being available.

## Example

Expand All @@ -12,7 +12,7 @@ In SwiftGodot a node is referenced as follows:
let marker = getNodeOrNull("Sprite2D/Marker2D") as? Marker2D
```

This requires the programmer to ensure that the path to the node, and its type, are correct. If there is a mismatch, the the `marker` variable will be nil.
This requires the programmer to ensure that the path to the node, and its type, are correct. If there is a mismatch, the `marker` variable will be nil.

If we run SceneGen on this project, our root `Player` type will be extended with typed descriptions of each node. These can then be accessed in a type-safe way:

Expand All @@ -26,7 +26,7 @@ The programmer is no longer responsible for maintaining the types and the paths.
I'm still figuring out the Swift PM story for how to run this, but in the meantime, here's an approach that works well:

1. Install Mint (`brew install mint`) if you don't already have it.
2. Add a file named `Mintfile` to your project and put `PadraigK/[email protected].2` in there.
2. Add a file named `Mintfile` to your project and put `PadraigK/[email protected].3` in there.
3. Run `mint bootstrap` (takes a while, maybe 5 mins)
4. Run code generation using `mint run scenegen <project-path> <output-path>` — note that output path will be **deleted** each time this is run before code is generated. This is necessary to clean up if you remove or rename a scene.

Expand Down

0 comments on commit b57e157

Please sign in to comment.