@@ -47,6 +47,11 @@ const BUILTIN_PROPS: Dictionary = {
47
47
"color" : Color ("03aa74" ),
48
48
"order" : 61 ,
49
49
},
50
+ "Graphics | Animation" :
51
+ {
52
+ "color" : Color ("03aa74" ),
53
+ "order" : 62 ,
54
+ },
50
55
"Sounds" :
51
56
{
52
57
"color" : Color ("e30fc0" ),
@@ -630,6 +635,47 @@ static func get_built_in_blocks(_class_name: String) -> Array[Block]:
630
635
"angular_velocity" : "Physics | Velocity" ,
631
636
}
632
637
638
+ "AnimationPlayer" :
639
+ var b = BLOCKS ["statement_block" ].instantiate ()
640
+ b .block_format = "Play {animation: STRING} {direction: OPTION} "
641
+ b .statement = (
642
+ """
643
+ if "{direction} " == "ahead":
644
+ play({animation} )
645
+ else:
646
+ play_backwards({animation} )
647
+ """
648
+ . dedent ()
649
+ )
650
+ b .defaults = {
651
+ "direction" : OptionData .new (["ahead" , "backwards" ]),
652
+ }
653
+ b .tooltip_text = "Play the animation."
654
+ b .category = "Graphics | Animation"
655
+ block_list .append (b )
656
+
657
+ b = BLOCKS ["statement_block" ].instantiate ()
658
+ b .block_format = "Pause"
659
+ b .statement = "pause()"
660
+ b .tooltip_text = "Pause the currently playing animation."
661
+ b .category = "Graphics | Animation"
662
+ block_list .append (b )
663
+
664
+ b = BLOCKS ["statement_block" ].instantiate ()
665
+ b .block_format = "Stop"
666
+ b .statement = "stop()"
667
+ b .tooltip_text = "Stop the currently playing animation."
668
+ b .category = "Graphics | Animation"
669
+ block_list .append (b )
670
+
671
+ b = BLOCKS ["parameter_block" ].instantiate ()
672
+ b .variant_type = TYPE_BOOL
673
+ b .block_format = "Is playing"
674
+ b .statement = "is_playing()"
675
+ b .tooltip_text = "Check if an animation is currently playing."
676
+ b .category = "Graphics | Animation"
677
+ block_list .append (b )
678
+
633
679
"Area2D" :
634
680
for verb in ["entered" , "exited" ]:
635
681
var b = BLOCKS ["entry_block" ].instantiate ()
0 commit comments