Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/romgerman/gdx

Godot Script XML (parody of JSX)
https://github.com/romgerman/gdx

godot godot-engine godot4

Last synced: about 1 month ago
JSON representation

Godot Script XML (parody of JSX)

Awesome Lists containing this project

README

        

# Godot Script XML

Just a proof of concept

# Installation

Place contents of `addons/gdx` folder into your `addons/gdx` folder.

# Usage

Use `GdxRender.render_text` to "render" nodes.

Example:

```gdscript
var output = GdxRender.render_text('








', self, {
"pos": Vector2(100, 100),
"pos2": Vector2(200, 200),
"text": "No hello"
})
```

`output.refs` contains refs you defined inside the code. It's a `Dictionary` with nodes.

Example:

```gdscript
var ref := output.refs.texture_ref as TextureRect
var tween = create_tween().set_trans(Tween.TRANS_SINE).set_loops()
tween.tween_property(ref, "scale", Vector2(1.2, 1.2), 0.25).set_delay(0.1)
tween.tween_property(ref, "scale", Vector2.ONE, 0.25).set_delay(0.1)
tween.play()
```

See full example inside `test_node.gd`.