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
(Moderators: fry, REAS)
   Class loop problems
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: Class loop problems  (Read 1686 times)

Class loop problems
« on: Apr 7th, 2005, 3:04am »

I'm trying to get some mouse response from an object of a class I created...It displays properly on the screen, but  will not respond to the mouseOver activity (meaning it doesn't change color upon hovering over the center ellipse..)
I tried debugging, but can't quite make it do what I want.
I'm also not sure whether to call the object from within the void loop() function.
Any help or pointers would be great!  
The example (with sample code) is up at:
http://research.calit2.net/solaris/tests/INFO_AESTHETICS_4_6_05c/applet/ index.html

222550793222550793 WWW
Re: Class loop problems
« Reply #1 on: Apr 7th, 2005, 9:38am »

Use the dist() methode to check the distance between the mouse and the center of the your ellipse:

instead of
if(overEllipse(X, Y, R, R))

222550793222550793 WWW
Re: Class loop problems
« Reply #2 on: Apr 7th, 2005, 10:06am »

Some hints:
it would be easyer to wrote
Node[] chaperts=new Node[14];
void setup(){
String[] ck={"a","b","c","d","e","f","g","h"};
int[] ckCount={3,6,5...}//the number of sections for each course
for(int i=0;i<chapters.length;i++){
 int courseNumber=i+1; number of the course  
 String s="chapter"+courseNumber;//create the couse name(chapter1, chapter2 ....)
 String[] c=new String[ckCount[i]];
 for(int j=0;j<c.length;j++){//create the sektion array(a course with 3 sektion got an array{"a","b","c"}
 chapters[i]=new Node(s,c);
void loop(){
 for (int i=0;i<chapters.length;i++){
Pages: 1 

« Previous topic | Next topic »