首页 > 其他分享 >godot tween

godot tween

时间:2024-10-29 20:58:05浏览次数:4  
标签:godot .. color 0.5 tween 待机 modulate

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.

标签:godot,..,color,0.5,tween,待机,modulate
From: https://www.cnblogs.com/draft/p/18514459

相关文章

  • 【论文精读】On the Relationship Between Self-Attention and Convolutional Layers
    【论文精读】OntheRelationshipBetweenSelf-AttentionandConvolutionalLayers作者:Jean-BaptisteCordonnier,AndreasLoukas,MartinJaggi发表会议:ICLR2020论文地址:arXiv:1911.03584v2目录【论文精读】OntheRelationshipBetweenSelf-AttentionandConv......
  • PyTorch - Difference between rand() and randn()
    rand()- Returnsatensorfilledwithrandomnumbersfromauniformdistributionontheinterval [0,1)torch.rand(100) tensor([0.7880,0.3032,0.3627,0.7082,0.1795,0.4985,0.9594,0.7900,0.9585,0.9081,0.1518,0.7774,0.5773,0.7038,0.......
  • Godot 载入Pck
    varpck_path="mod.pck"varsprite_frames_path="res://tres/main_mod.tres" ifProjectSettings.load_resource_pack(pck_path): print("PCK加载成功") #从PCK文件中加载SpriteFrames资源 varsprite_frames=load(sprite_frames_path......
  • 游戏中脚本方式值修改-Godot Engine
    游戏为Tower.Tactics.Liberation游戏使用引擎GodotEngine,版本3.5.2游戏中的数值全是脚本中修改,内部名称为GDScript游戏运行中脚本的主函数为GDScriptFunction__call,脚本运行时的ip值只有在栈上储存,需要在函数中间Hook,获取到脚本的ip,顺便一起获取codeptrAsmHook......
  • Unity使用DOTween实现金币飞入效果
    1publicGameObjectshowRewardPanel;2publicTextSetCoinText;3publicTextSetLevelText;//经验exp4privateintgetCoin;5privateintgetExp;6publicImagecoinImage;7publicImagetargetImage;8publicCameramainCamera;9publicTextMeshco......
  • What is the difference between a Homemaker and a Housewife?
    Theterms"homemaker"and"housewife"areoftenusedinterchangeably,buttheycancarrydifferentconnotationsandimplications:HomemakerDefinition:Ahomemakerisgenerallysomeonewhomanagesahouseholdandtakescareofhome-re......
  • 学习011-03-03 Relationships Between Persistent Objects in Code and UI(代码和用户
    RelationshipsBetweenPersistentObjectsinCodeandUI(代码和用户界面中持久对象之间的关系)Whendesigningabusinessmodel,itcanbenecessarytosetspecificrelationshipsbetweenbusinessobjects.Thistopicdescribeshowtosettheserelationshipsbe......
  • Understanding the difference between a Java keystore and a truststore
    Atruststoreisafilethatcontainsoneormorepubliccertificates,butnoprivatekeys. Akeystoreisafilethatcontainsoneormorepubliccertificatesandoneormoreprivatekeys.Thisistypicallya"chain"wherethekeystorecontain......
  • 四款负载均衡工具Nginx、HAProxy、MetalLB、gobetween 比较
    以下是对Nginx、HAProxy、MetalLB和gobetween四个开源负载均衡工具的详细对比与分析:Nginx:优点:工作在网络的7层之上,可以针对HTTP应用做一些分流策略,如基于域名、目录结构分流。对网络稳定性依赖小,理论上能ping通就能进行负载均衡。安装和配置简单,有清晰的日志用于排查和管理。支持......
  • springintegration handle message with messagid between three channels
    InSpringIntegration,handlingamessageacrossmultiplechannelswhilepreservingamessageId(orsimilaridentifier)canbeachievedbyleveragingmessagerouting,channels,andcustommessageheaders.Here’showyoucanrouteandprocessmessagesbetw......