user interface - SKButton not working -


so made button programmatically spritekit thinks button node larger button.

here have.

 override func didmovetoview(view: skview) {     let button = skspritenode(color: skcolor.greencolor(), size: cgsizemake(100, 44))     button.position = cgpoint(x: cgrectgetmidx(self.frame), y: cgrectgetmidy(self.frame))     self.addchild(button) }   override func touchesbegan(touches: nsset, withevent event: uievent) {     touch: anyobject in touches {         let location = touch.locationinnode(self)         if button.containspoint(location) {             println("tapped")         }     } } 

when run game allows me click button detects touch anywhere below button.


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -