Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to save animated GIF #104

Merged
merged 12 commits into from
Jul 19, 2021
Merged

Add ability to save animated GIF #104

merged 12 commits into from
Jul 19, 2021

Conversation

Xrayez
Copy link
Contributor

@Xrayez Xrayez commented Jul 19, 2021

This adds ability to save both static and animated GIFs.

Example

animated_rotation

This rotating Goost icon was produced with:

func save_gif_animated_rotation():
	var image_frames = ImageFrames.new()

	var angle = 0.0
	for i in 32:
		var frame = Image.new()
		frame.load("res://icon.png")
		GoostImage.rotate(frame, angle, false)
		var delay = 0.02
		image_frames.add_frame(frame, delay)
		angle += TAU / 32.0

	image_frames.save_gif("res://animated_rotation.gif")

@Xrayez Xrayez added this to the 1.1-gd3 milestone Jul 19, 2021
[ci skip]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant