|
Author |
Topic: color declaration before setup() (Read 204 times) |
|
heliodrop Guest
|
color declaration before setup()
« on: Jul 17th, 2003, 4:47pm » |
|
Hello. I have a little question. I dont understand why this code works: // Color Test : OK void setup() { size(200, 200); } void loop() { color black = color(0, 0, 0); color white = color(255, 255, 255); setPixel(10, 10, black); setPixel(20, 20, white); } // End and why this one doesn't: // Color Test : NullPointerException color black = color(0, 0, 0); color white = color(255, 255, 255); void setup() { size(200, 200); } void loop() { setPixel(10, 10, black); setPixel(20, 20, white); } // End I have a NullPointerException (when I run the 2nd sketch), and I don't understand why. Because all other type of variables (int, float, etc...) can be defined before the setup() function. (the revision number 0056 i'm using win9 Does anyone can explain me that ? thanks!
|
|
|
|
heliodrop Guest
|
Re: color declaration before setup()
« Reply #1 on: Jul 17th, 2003, 4:50pm » |
|
i'm really sorry, this is a bug report and not a bug fixes
|
|
|
|
|