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)
   properties question
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: properties question  (Read 819 times)
gaza


properties question
« on: Dec 31st, 2002, 4:26pm »

how can I retrieve the properties of say... a point i draw. do I have to name that point?
 
also... let's say I load and Image.. can I retrieve the x and  y positions of that image like
BImage a;...etc
a.x;
 
thanks
 
fry


WWW
Re: properties question
« Reply #1 on: Jan 2nd, 2003, 5:50pm »

nah, the drawing stuff isn't that smart yet.
 
for now, the only things you can retrieve are the pixel values for a point, like the getPixel stuff:
http://proce55ing.net/reference/image.html#Getting_and_Setting_Pixels
 
which can also be combined with red/green/blue/.. commands for simpler code:
http://proce55ing.net/reference/colors.html#Creating_and_Reading_Color
 
gaza


Re: properties question
« Reply #2 on: Jan 3rd, 2003, 12:32am »

Thanks Fry.
 
benelek

35160983516098 WWW Email
Re: properties question
« Reply #3 on: Jan 7th, 2003, 8:30am »

well, if you really wanted to work that way, you could define a class which would draw the shape, and store the coordinates used as variables within the object.
 
for example:
 
Code:

 
 
class TheEllipse {
 
  int x, y, size;
  
  TheEllipse (int ix, int iy, int isize) {
    x = ix;
    y = iy;
    size = isize;
  }
  
  void draw() {
    ellipse(x, y, size, size);
  }
  
}
 
 

 
then you could access the coordinates of the ellipse by using EllipseName.x, and EllipseName.y
 
-jacob
« Last Edit: Jan 7th, 2003, 8:30am by benelek »  
Pages: 1 

« Previous topic | Next topic »