sprite kit - How to get the initial location of a continuous touch in swift -
i'm building first game in swift , want execute code block places sprites @ fingers touch location- if touch started outside of area of display. touch may or may not continuous, , therefore may or may not continuously generating new sprites, logic in touchesmoved. right i'm using
for touch : anyobject in touches { let location = touch.locationinnode(self) ... to grab each touch location. however, seems continuously updated , i'm not sure how reference 1 specific touch , starting point (assuming multiple fingers down @ time). looked uitouch phase, touchended, see if work out other way of going problem, can't figure out how access phase of touch using apple docs. (this doesn't seem work: touch.phase == uitouchphase.ended
i think i'm fundamentally misunderstanding how handle multiple touch events , how pass information between them (touchesbegan,touchesmoved,touchesended). may missing obvious, i'm surprised docs did seemingly-poor job explaining , there don't seem many answers online regarding question. awesome.
Comments
Post a Comment