1234567891011121314151617181920212223242526272829303132333435363738 |
- extends Sprite
- var frame1 = 0
- export(NodePath) var node
- export var anim = 'run'
- export var fps = 15
- func _ready():
- set_physics_process(false)
- func _physics_process(delta):
- get_node(node).set_active(false)
- var frametext = str(frame1)
- if frame1 < 10 :
- frametext = "0" + frametext
- var filename2 = "res://anim/texture-image-saved"+str(frametext)+".png"
- print("Saving PNG for Frame: " + str(frame1))
- var img = texture.get_data()
- img.clear_mipmaps()
- var x = img.save_png(filename2)
- print("Saved.")
- frame1 += 1
- get_node(node).set_active(true)
- func _on_AnimationPlayer_animation_finished(anim_name):
- set_physics_process(false)
- pass # Replace with function body.
- func _on_AnimationPlayer_animation_started(anim_name):
- set_physics_process(true)
- pass # Replace with function body.
- func _on_Timer_timeout():
- Engine.iterations_per_second = fps
- get_node(node).play(anim)
- set_physics_process(true)
- pass # Replace with function body.
|