Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [gd_scene load_steps=4 format=2]
- [ext_resource path="res://icon.png" type="Texture" id=1]
- [sub_resource type="GDScript" id=2]
- script/source = "extends Node2D
- onready var anim: = $AnimationPlayer
- const slow: = 1.0
- const fast: = 2.0
- func _input(event:InputEvent)->void:
- if event is InputEventMouseButton:
- if event.button_index == 1:
- if event.pressed:
- anim.playback_speed = fast
- else:
- anim.playback_speed = slow
- "
- [sub_resource type="Animation" id=1]
- resource_name = "Spin"
- loop = true
- tracks/0/type = "bezier"
- tracks/0/path = NodePath("Sprite:rotation_degrees")
- tracks/0/interp = 1
- tracks/0/loop_wrap = true
- tracks/0/imported = false
- tracks/0/enabled = true
- tracks/0/keys = {
- "points": PoolRealArray( 0, -0.25, 0, 0.25, 0, 360, -0.25, 0, 0.25, 0 ),
- "times": PoolRealArray( 0, 1 )
- }
- [node name="Node2D" type="Node2D"]
- script = SubResource( 2 )
- [node name="AnimationPlayer" type="AnimationPlayer" parent="."]
- autoplay = "Spin"
- anims/Spin = SubResource( 1 )
- [node name="Sprite" type="Sprite" parent="."]
- position = Vector2( 169, 113 )
- texture = ExtResource( 1 )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement