godot tween

extends Button
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _on_button_down():
var tween = create_tween()
var initial_color = Color(0,0,0)
initial_color = $"../待机".modulate
var target_color = Color(1, 0, 0) # 蓝色
tween.tween_property($"../待机", "modulate:a", 0.0, 0.5)
tween.tween_property($"../待机", "modulate", target_color, 0.5)
tween.tween_property($"../待机", "modulate", initial_color, 0.5)
tween.tween_property($"../待机", "modulate:a", 1.0, 0.5)
tween.set_trans(Tween.TRANS_LINEAR)
tween.set_ease(Tween.EASE_IN_OUT)
tween.set_trans(Tween.TRANS_LINEAR)
tween.set_ease(Tween.EASE_IN_OUT)
pass # Replace with function body.
posted @   eva1024  阅读(10)  评论(0编辑  收藏  举报
(评论功能已被禁用)
相关博文:
阅读排行:
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
· 上周热点回顾(2.17-2.23)
点击右上角即可分享
微信分享提示