Mercurial > hg > tweakathon2ios
annotate xyView.cpp @ 52:89944ab3e129 tip
fix oF linker errors ios8
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Tue, 03 Feb 2015 13:18:23 +0000 |
parents | a223551fdc1f |
children |
rev | line source |
---|---|
rt300@0 | 1 // |
rt300@0 | 2 // xyView.cpp |
rt300@0 | 3 // soundspeed |
rt300@0 | 4 // |
rt300@0 | 5 // Created by Robert Tubb on 20/05/2013. |
rt300@0 | 6 // |
rt300@0 | 7 // |
rt300@0 | 8 |
rt300@0 | 9 #include "xyView.h" |
rt300@0 | 10 |
rt300@0 | 11 void XYView::draw(){ |
rt300@0 | 12 |
rt300@0 | 13 ofFill(); |
rt300@0 | 14 ofNoFill(); |
rt300@0 | 15 ofSetColor(0,0,155); |
rt300@0 | 16 |
rt300@0 | 17 ofRect(screenX, screenY, width, height); |
rt300@0 | 18 ofCircle(screenX+ctrlX, screenY+ctrlY, 60); |
rt300@0 | 19 // cross hairs |
rt300@0 | 20 |
rt300@0 | 21 ofLine(screenX+ctrlX - 30, screenY+ctrlY, screenX+ctrlX + 30, screenY+ctrlY); |
rt300@0 | 22 ofLine(screenX+ctrlX,screenY+ctrlY - 30,screenX+ctrlX,screenY+ctrlY+30); |
rt300@0 | 23 |
rt300@0 | 24 } |
rt300@0 | 25 |
rt300@0 | 26 bool XYView::handleTouch(double x, double y){ |
rt300@0 | 27 if(isInMyArea(x,y)){ |
rt300@0 | 28 ctrlX = x; |
rt300@0 | 29 ctrlY = y; |
rt300@0 | 30 |
rt300@0 | 31 return true; |
rt300@0 | 32 }else{ |
rt300@0 | 33 return false; |
rt300@0 | 34 } |
rt300@0 | 35 |
rt300@0 | 36 } |
rt300@0 | 37 bool XYView::isInMyArea(int x, int y){ |
rt300@0 | 38 return (x > screenX && x < screenX + width && y > screenY && y < screenY + height); |
rt300@0 | 39 } |