PopKernel
PopKernel

Reputation: 4270

watchOS SKScene.convertPoint(fromView:) unavailable?

I'm working on a watchOS SpriteKit project. I know I can get the location of a tap within the displayed scene using WKTapGestureRecognizer, but I noticed that SKScene.convertPoint(fromView point:) is unavailable in watchOS.

So, how do I convert the CGPoint provided by WKTapGestureRecognizer.locationInObject() to a point in the SpriteKit scene?

Upvotes: 1

Views: 279

Answers (1)

Knight0fDragon
Knight0fDragon

Reputation: 16827

See https://developer.apple.com/library/content/samplecode/HelloGameKit/Listings/HelloGameKit_WatchKit_Extension_GameScene_swift.html

It will show you how to develop SpriteKit apps for apple watch. There is too much code to explain what is going on here. But the basic jist of it looks like your node.position is your location's position, no need to convert

Upvotes: 2

Related Questions