https://github.com/diklor/tw
easy tween
https://github.com/diklor/tw
Last synced: 6 months ago
JSON representation
easy tween
- Host: GitHub
- URL: https://github.com/diklor/tw
- Owner: diklor
- License: apache-2.0
- Created: 2023-10-07T06:51:25.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-21T09:03:15.000Z (over 2 years ago)
- Last Synced: 2025-03-03T04:15:32.939Z (over 1 year ago)
- Language: GDScript
- Size: 730 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tw
Easy tween
## Default parameters:
```gdscript
tw.tw(
node = null, #required
time = 0.1, #required
property_dict = {}, #required
easing_style = 'linear',
easing_direction = 'out',
delay = null
)
```
## Configuration:
```gdscript
tw.set_default_time(1.0)
#tw.set_default_easing(style := '', direction := '')
tw.set_default_easing('quint')
tw.set_default_easing('quint', 'out')
```
## Usage:
```gdscript
tw.set_default_time(1.0)
tw.set_default_easing('quint')
tw.tw(self, 1.0, {modulate = Color.RED})
tw.tw($Node, 1.0, {modulate = Color.RED, rotation = 360}, 'quint', 'out')
tw.tw(self, 1.0, {modulate = Color.RED, "position:x" = 20}, 'QuiNT', 'OuT')
tw.tw(self, 1.0, {modulate = Color.RED}, 'quint', 'in')
tw.tw(self, 1.0, {modulate = Color.RED}, 'elastic', 'out')
tw.tw(self, 1.0, {modulate = Color.RED}, 'elastic')
tw.tw(self, 0.0, {modulate = Color.RED}, 'elastic')
#equivalent to "self.modulate = Color.RED"
tw.tw(self, -2.0, {modulate = Color.RED}, 'elastic')
#equivalent to "self.modulate = Color.RED"
```