Getting GIf undefined error while creating an object of Gif
in
Contributed Library Questions
•
1 year ago
Hi,
I have developed an application. playing gif animation.
want to load my animation by seperate thread because it is taking time to get loaded.
I have written following files
1. main class in which i am writing an "animThread" class and creating an object of gif animation.
2. Base class - written initAnimation function and creating a Thread to call that function
3. respective "Screen" classe in which i want to load animations extendes from base class
My Code: -
------------Main file--------------
import gifAnimation.*;
Gif trainingAnimation =null;
void setup
{
........
}
class animThread implements Runnable{
String m_animName;
String m_animName;
public animThread(String animName) {
m_animName = animName;
}
public void run() { // thread dies when finished
trainingAnimation = new Gif(this, m_animName); //Getting error as constructor Gif undefined
}
m_animName = animName;
}
public void run() { // thread dies when finished
trainingAnimation = new Gif(this, m_animName); //Getting error as constructor Gif undefined
}
--------------------------------------------
------------Base Class ---------------
class Base
{
void initAnimation(String animationName)
{
String path = "animationName.gif";
animThread loadanimation = new animThread(animationName);
Thread t1 = new Thread(loadanimation);
t1.start();
}
{
void initAnimation(String animationName)
{
String path = "animationName.gif";
animThread loadanimation = new animThread(animationName);
Thread t1 = new Thread(loadanimation);
t1.start();
}
----------------------------------------------
----------Screen class in which i am calling an animation to show---------
class Screen extends Base {
Screen (){
initAnimation("loading");
}
----------------------------------------------------------------------------------------------------
I am getting an error marked in red. please help me how to resolve this. i want to load my animation by seperate thread.
as per my understanding this error is because of "
this" pointer passing in Gif argument which is of "PApplet" type.
Thanks in advance.
1