simple class question - passing into an object

i’ve been working through the examples in the wiki, i have done a good deal of work with the bouncing ball class and objects. so far so good, however, i would like to add a unique label to them. i’m not sure how this would go. i had the idea to add a method to transfer the info into the object, doesn’t work so well… here’s some snipets…

the draw works fine… i would like to assign a number to the object so i can see what’s what… this is how it think it should go…

thanks
_J

  
	for(int l=0; l<NBALLS; l++)  
	{  
		myBall[l].assignTag(l);  
		myBall[l].draw();  
		  
  
	}  

way down at the bottom…

  
  
#include "ofBall.h"  
  
ofBall::ofBall()  
{  
	speed_x = ofRandom(-1,1);  
	speed_y = ofRandom(-1,1);  
	  
	x = ofRandom(0, ofGetWidth());  
	y = ofRandom(0, ofGetHeight());  
	  
	tag = 999;  
	  
	dim = 10;  
}  
  
void ofBall::update(){  
	  
	if(x<0){  
		x=0;  
		speed_x *= -1;  
	}else if(x > ofGetWidth()){  
		x = ofGetWidth();  
		speed_x *= -1;  
	}  
	  
	if(y<0){  
		y = 0;  
		speed_y *= -1;  
	}else if(y > ofGetHeight()){  
		y = ofGetHeight();  
		speed_y *= -1;  
	}  
	  
	x+=speed_x;  
	y+=speed_y;  
}  
  
void ofBall::draw(){  
	//not passing in color vaules, defaults to red  
	//maybe write an overloaded draw, to control dim, and color  
	  
	ofSetColor(40,100,170);  
	ofCircle(x,y,dim);  
	ofDrawBitmapString("Tag"+string_tag, x+6, y+6);  
	  
}  
  
//---------------------------  
float ofBall::getx(){  
  
return x;  
}  
//---------------------------  
  
float ofBall::gety(){  
  
return y;  
}  
  
//---------------------------  
void assignTag(int tag){  
	  
	string_tag = ofToString(tag);  
  
}  

  
  
  
#ifndef _OF_BALL  
#define _OF_BALL  
  
#include "ofMain.h"  
#include "stdio.h"  
  
class ofBall{  
  
public:  
  
	//methods  
	void update();  
	void draw();  
	float gety();  
	float getx();  
	void assignTag(int tag);  
		  
	//constructor  
	ofBall();  
	  
	//varibles  
	float x;  
	float y;  
	int dim;  
	float speed_x;  
	float speed_y;  
	  
	int tag;  
	string string_tag;  
	  
	  
	  
private:  
  
};  
  
#endif