FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   rect --> box
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: rect --> box  (Read 258 times)
Koenie

170825270170825270koeniedesign WWW Email
rect --> box
« on: Sep 13th, 2003, 12:16pm »

If I would make a box on the same place a rectangle could be, would this be the correct syntax?
 
Code:
// this is rectangle code
rect(x, y, w, h);
 
// this is box code
push();
translate(x, y);
box(w, h, 20);
pop();

 
Would this make the box appear on the same place as the rectangle? I tried it, and the rectangle and the box weren't at the same position.
 
Koenie
 

http://koeniedesign.com
Koenie

170825270170825270koeniedesign WWW Email
Re: rect --> box
« Reply #1 on: Sep 13th, 2003, 12:23pm »

I got it fixed already. I forgot that the box draws from its middle point and the rect normally draws from the top left point. Problem solved
 
Koenie
 

http://koeniedesign.com
Pages: 1 

« Previous topic | Next topic »