Created
December 18, 2009 22:18
-
-
Save ghostandthemachine/259801 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Toggle extends BaseObject{ | |
Toggle(){ | |
super("",1,1,mouseX,mouseY); | |
w = 25; | |
h = 25; | |
scaleable = false; | |
} | |
void display(){ | |
super.display(); | |
pushStyle(); | |
stroke(0); | |
fill(cfillColor); | |
rect(x,y,w,h); | |
if(value % 2 != 0){ | |
line(x + 3, y + 3, x + w - 3, y + h - 3); | |
line(x + w - 3, y + 3, x + 3, y + h - 3); | |
} | |
popStyle(); | |
} | |
void press(int mx, int my){ | |
super.press(mx,my); | |
if(editMode != true){ | |
if(press){ | |
value+=1; | |
println(value); | |
} | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment