beginner object/library question
in
Programming Questions
•
3 years ago
I would like to load a library object in an class I created. I am not too sure how to code it.
I want to load the Gif class from the gifAnimation library into a class
In my main class
I have
- import gifAnimation.*;
- drone myDrone;
- public void setup() {
- myDrone = new drone();
- size(400,400,P2D);
- frameRate(20);
- }
- void draw()
- {
- background(0);
- myDrone.circle();
- }
then in my object (called drone) I have :
- class drone
- {
- Gif drone_up = new Gif(this, "drone_up.gif");
- Gif drone_front = new Gif(this, "drone_front.gif");
- Gif drone_left = new Gif(this, "drone_left.gif");
- Gif drone_right = new Gif(this, "drone_right.gif");
- drone()
- {
etc...
but get that the constructor Gif is undefined - error
Is it because the "
this" is not pointing at the main class ?
not sure I am going in the right direction here
ponnuki.net
ponnuki.net
1