Mercurial > hg > tweakathon2ios
diff xyView.h @ 0:a223551fdc1f
First commit - copy from tweakathlon.
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Fri, 10 Oct 2014 11:46:42 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xyView.h Fri Oct 10 11:46:42 2014 +0100 @@ -0,0 +1,39 @@ +// +// xyView.h +// soundspeed +// +// Created by Robert Tubb on 20/05/2013. +// +// + +#ifndef __soundspeed__xyView__ +#define __soundspeed__xyView__ + +#include <iostream> +#include "ofMain.h" + +// very sketchy XY + +class XYView{ +private: + float screenX, screenY, height, width; + float ctrlX, ctrlY; + + bool isInMyArea(int x, int y); + +public: + + XYView(double x, double y, double w, double h){ + screenX = x; + screenY = y; + width = w; + height = h; + ctrlX = w*0.5; + ctrlY = h*0.5; + } + void draw(); + bool handleTouch(double x, double y); // return false if ouside my area + +}; + +#endif /* defined(__soundspeed__xyView__) */