How to transform UIView's bounds space like GL space?
I'm handling UITouch
event sourced from UIView
. The problem is the coordinates are specified in UIView's bounds, left-top corner originated point space. But my GL viewport is defined in left-bottom originated (Y-flipped), pixel space.
I can convert all touch coordinates manually, however, if I could set custom transform on coordinate system of UIView, this will be solved automatically. Is this possible? What I want to do ultimat开发者_运维百科ely is receiving UITouch
with my custom coordinate system.
Use an affine transform:
CGAffineTransform transform = CGAffineTransformMakeScale(1.0, -1.0);
view.transform = transform;
精彩评论