Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
dlabat.bavc
dlabat.bavc's Profile
1
Posts
1
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
constuctor schoolApp.imageButton(...) is undefined
[4 Replies]
31-Jan-2012 08:50 PM
Forum:
Programming Questions
I'm a totally new to processing, like 2 or 3 days in, and I cam upon the first thing i really am having trouble trying tp troubleshoot. there is an error message when attempting to run the app (schoolApp)
schoolApp is:
import ddf.minim.*;
ImageButton play, next, last;
// Images for buttons
PImage playBase, playOver, playDown, nextBase, nextOver, nextDown, lastBase, lastOver, lastDown;
// Background colors
int r, g, b = 0;
// Position of and size of image buttons
int x, y, w, h, xn, xp, xl;
// Custom External class's
Button button;
void setup() {
size(640, 480);
background(r, g, b);
playBase = loadImage("playBase.png");
playOver = loadImage("playOver.png");
playDown = loadImage("playDown.png");
nextBase = loadImage("nextBase.png");
nextOver = loadImage("nextOver.png");
nextDown = loadImage("nextDown.png");
lastBase = loadImage("lastBase.png");
lastOver = loadImage("lastOver.png");
lastDown = loadImage("lastDown.png");
x = width;
y = height*9/12;
w = 72;
h = 72;
xn = x*2/12;
xp = x*5/12;
xl = x*8/12;
next = new ImageButton(x, y, w, h, nextBase, nextOver, nextDown);
play = new ImageButton(x, y, w, h, playBase, playOver, playDown);
last = new ImageButton(x, y, w, h, lastBase, lastOver, lastDown);
}
void draw() {
next.update();
play.update();
last.update();
next.display();
play.display();
last.display();
}
imageButton is
class ImageButton extends Button {
PImage Base;
PImage Over;
PImage Down;
PImage currentimage;
ImageButtons(int ix, int iy, int iw, int ih, Pimage iBase, PImage iOver, Pimage iDown) {
x = ix;
y = iy;
w = iw;
h = ih;
Base = iBase;
Over = iOver;
Down = iDown;
currentimage = base;
}
void update() {
over();
pressed();
if (pressed) {
currentimage = Down;
}
else if (over) {
currentimage = Over;
}
else {
currentimage = Base;
}
}
void over()
{
if ( overRect(x, y, w, h) ) {
over = true;
}
else {
over = false;
}
}
void display()
{
image(currentimage, x, y);
}
}
if I could get some help that would be greatly appreciated
i will post the code on github if it helps to get everything I have.
«Prev
Next »
Moderate user : dlabat.bavc
Forum