system
October 13, 2017, 5:00pm
1
Attention
Topic was automatically imported from the old Question2Answer platform.
Asked By
DodoIta
Old Version
Published before Godot 3 was released.
Hi everyone,
I wanna interpolate the opacity of an AnimatedSprite using a Tween node in Godot 3.0, but there’s no opacity property in the inspector, since I tried
"visibility/opacity"
which worked fine in 2.1, but has no effect here.
Does that mean they haven’t implemented it yet or am I using the wrong property string?
system
October 13, 2017, 9:24pm
4
Reply From:
kidscancode
In 3.0, the property is modulate
, which combines color and transparency.
To tween the property, since the value is a Color, you have to give two colors as an argument. So to just fade the sprite you’d do this:
$Tween.interpolate_property($AnimatedSprite, "modulate",
Color(1, 1, 1, 1), Color(1, 1, 1, 0), 2.0,
Tween.TRANS_LINEAR, Tween.EASE_IN)
Thanks, it works!
I actually got there, but I kept using Color(255, 255, 255, 0)
because I got confused with CSS
BTW I love your videos, keep up the good work!
`
DodoIta | 2017-10-14 08:34