This commit is contained in:
Torsten 2024-12-22 12:24:50 +01:00
parent d16160323c
commit 1e22d28754
34 changed files with 708 additions and 1822 deletions

View file

@ -0,0 +1,28 @@
Tweens are created using a nodes' create_tween() method
```python
func slide_in() -> void:
var tween := create_tween()
tween.set_trans(Tween.TRANS_QUART)
tween.set_ease(Tween.EASE_OUT)
````
Running tweens in parallel via parallel method.
Modulate controls tinting, subproperty a is for alpha, meaning a target visibilty of 100%
```python
tween.parallel().tween_property(body, "modulate:a", 1.0, 0.2)
```
Full tween method:
```python
func slide_in() -> void:
var tween = create_tween()
tween.set_trans(Tween.TRANS_QUART)
tween.set_ease(Tween.EASE_OUT)
body.position.x = 200.0
tween.tween_property(body, "position:x", 0.0, 1.0) # Move x from 200 to 0
body.modulate.a = 0.0 # UI node visibility = 0
tween.parallel().tween_property(body, "modulate:a", 1.0, 1.0) # Animate visibility towards 100% (a=alpha)
```