Simple Question: How to Load an Animated GIF Into the Background of a Processing Sketch?

Hello, everybody!

I have a quick (and probably simple for most Processing coders) question: How do I load an animated GIF into the background of a Processing sketch?

The GIF remains in its first frame (when I load it in draw()), and I assume it does so because the sketch calls draw() continuously. How do I avoid this problem? I tried using preload() to load the image, but the other methods no longer recognize the field (PImage bg) when I do so, and I need the background to remain uniform as other images move around on top of it.

I have searched for other responses on this forum, but I am having trouble implementing their solutions. Is there no way to load a GIF onto the screen using just preload(), setup(), and draw()? (I also am not extremely familiar with preload() (aside from the fact that it runs once before setup() is called), so perhaps somebody could help me out!)

Thank you for your time!

Tagged:

Answers

Sign In or Register to comment.