Revision 66 ofxArgosUI_XYPad.h

ofxArgosUI_XYPad.h (revision 66)
1 1
/***********************************************************************
2 2
 
3
 Copyright (c) 2009 Dimitri Diakopoulos, http://www.dimitridiakopoulos.com/
4
 === Google Summer of Code 2009 - NUI Group === 
3
 Copyright (c) 2009, 2010 Dimitri Diakopoulos, http://www.dimitridiakopoulos.com/
5 4

  
6
 Portions Copyright (c) 2008, 2009 Memo Atkens, http://www.memo.tv/
5

  
6
 Portions Copyright (c) 2008, 2009 Memo Aktens, http://www.memo.tv/
7 7
 -> Based on ofxSimpleGuiToo
8 8
 
9 9
 Portions Copyright (c) 2008 Todd Vanderlin, http://toddvanderlin.com/
......
92 92
	}	
93 93
	
94 94
	// ============================================= Mouse
95
	void focusActive() { if (canfocus) focus.set(this); }
96

  
95 97
	void onPress(int x, int y, int button) {
96 98
		lock = true;
97 99
		point.set(x, y);
98
		focus.set(this); 
99 100
	}
100 101
	
101 102
	void onDragOver(int x, int y, int button) {
......
177 178

  
178 179
			// Pad Area
179 180
			rRectangle(0, 0, width, height, 4);
180
			
181
			// Bottom text area
182
			//setTextBGColor();
183
			//ofRect(0, height, width, 20);
184 181

  
185 182
			// Draw the text
186 183
			setTextColor();
187
			myFont.drawString("" + ofToString(value->x, 1) + "/" + ofToString(value->y, 1), 2, height - 5 );
184
			argosText::font.drawString("" + ofToString(value->x, 1) + "/" + ofToString(value->y, 1), 2, height - 5 );
185
	
186
			// Draw once filled
187
			ofEnableSmoothing();
188
				ofFill();
189
					setTextColor();
190
					ofCircle(pointv.x - x, pointv.y - y, 8);
188 191

  
189
			// Draw the crosshairs 
190
			//setTextBGColor();
191
			//ofLine(pointv.x - x, 0, pointv.x - x, height);
192
			// ofLine(0, pointv.y - y, width, pointv.y - y);
193
			
194
			// Draw circle in middle of crosshairs
195
			setTextColor();
196
			ofCircle(pointv.x - x, pointv.y - y, 8);
192
					ofSetColor(240, 240, 240); 
193
					ofCircle(pointv.x - x, pointv.y - y, 6);
197 194

  
198
			ofSetColor(240, 240, 240); 
199
			ofCircle(pointv.x - x, pointv.y - y, 6);
195
				// Draw the outside and center again as outlines (for anti-aliasing)
196
				ofNoFill();
197
					setTextColor();
198
					ofCircle(pointv.x - x, pointv.y - y, 8);
200 199

  
200
					ofSetColor(240, 240, 240); 
201
					ofCircle(pointv.x - x, pointv.y - y, 6);
202

  
203
			ofDisableSmoothing();
204

  
201 205
		glPopMatrix();
202 206

  
203 207
		//ofDisableAlphaBlending();

Also available in: Unified diff