Looking at all the libraries for this, I realized that, at least in my case, they were massive overflows. I just wanted to make a video with a preview of the applications, and I just needed this for two places in my application.
So, I spent a little time and came up with the following code that you can use with a SpriteKit-based scene to turn on the scene-by-scene touchscreen display. (And, if you start from scratch, you can subclass SKScene and bake that right for use by all your scenes.)
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; CGPoint location = [touch locationInNode:self]; SKNode *node = [self nodeAtPoint:location]; #ifdef weBeRecording
Of course, you will need to make the touchMarker.png file yourself. I created mine in Photoshop, and it's just a simple 100x100 white circle with 50% transparency. Honestly, it took more time to get this image as soon as this happened to get the code to work. (If there is a way to attach images here, I will do it. But, um, this is my first day. Yes.)
One caveat, you will discover and save the originally affected node (stored here in the "node" variable) before you do this. If you do not, the original value will be lost, and none of your node tests will work after displaying the touch marker.
Hope this helps someone else!
Dis
Steven W. Disbrow
source share