- Home /
Animated Gif
How can I play an animated Gif, in Unity?
I had a similar case where I solved like this.
public var pictureArray:Texture[];
private var picture:Texture;
private var delay:int = 0;
private var count:int = 0;
function OnGUI ()
{
delay++;
if(delay % 20 == 0)
{
count++;
if(count == pictureArray.Length)
count = 0;
picture = pictureArray[count];
delay = 0;
}
}
so that now ur picture is changing dynamically, use it for a guiTexture or inside a GUI window ...
Answer by Eric5h5 · May 22, 2012 at 02:31 AM
If you write an animated GIF parser yourself, yes. Otherwise no.
I already have the animated GIF, but does not PLay, Is freeze on the First Frame.
Well, yes, because (as I said), there is no animated GIF support. Unless you write it yourself.
still gif is not a good format to work with anyway!?! is it!?
Not really, though I would say there's a certain appeal to the idea of using an animated graphic format where it's really easy to preview the animation in a standard way, rather than working with sprite sheets. Anyway the only hard part about writing an animated GIF importer would be dealing with the compression. Although that is a fairly major hard part.
No its not good format, but the problem is that I cannot play an $$anonymous$$Pg or whatever video format, that unity gave me as error.
Error building Player: Couldn't build player because of unsupported data on target platform. and I need to put a video inside a plane.
Answer by Venryx · Mar 03, 2014 at 07:59 PM
You could also try a script like the following, which makes use of Mono's System.Drawing library: http://wiki.unity3d.com/index.php/AnimatedGifDrawer
Your answer
Follow this Question
Related Questions
Touch Not Working 0 Answers
Make an object move in the direction of touch 0 Answers
A node in a childnode? 1 Answer
Android double jump not working correctly 1 Answer
smooth movement with rigidbody2D 1 Answer