Hi everyone, I’m new to Godot. I’m trying to create a character maker. At the moment, there is a shader that changes the color of the animated sprite.
Now I’m trying to write a script that saves the result in png by button pressed, but so far I’ve only managed to save the frame from the animation without the shader applied.
extends Button
func _on_pressed():
var sprite = get_node("../CharacterSprite")
var animation = sprite.get_animation()
var frames = sprite.get_sprite_frames()
for i in frames.get_frame_count(animation):
print(i)
var texture = frames.get_frame_texture(animation, 0)
var image = Image.new()
image = texture.get_image()
image.save_png("file.png")
How do I save a frame with a changed color?