setting a variable to = width/2 or height/2?
in
Programming Questions
•
1 year ago
when ever i set a variable lets say x = width and y=height/2 ......well it never freaking works....why?
for example:
- void setup() {
- size(800,600);
- }
- int x = width/2;
- int y = height/2;
- void draw() {
- ellipse(x,y,50,50);
- }
the ellipse will not show up in the middle of the screen for me but if i do :
- void setup() {
- size(800,600);
- }
- //int x = width/2;
- //int y = height/2;
- void draw() {
- ellipse(width/2,height/2,50,50);
- }
the ellipse shows up in the middle of the screen....
whyyy??
1