Nour
Nour

Reputation: 343

Can I access to touched node properties in touchBegan method in swift?

I want to know a property of the touched node and then change it without using node name.

Upvotes: 1

Views: 64

Answers (1)

Confused
Confused

Reputation: 6278

Yes, in the touchesBegan method override you have full access to self. so can do anything you want with the node from there.

Similarly, in the other touchesEnded, touchesMoved

If you're coming from Unity, the biggest difference is the lack of update and fixedUpdate access inside the nodes. You can only get at this game loop stuff from within the Scene node.

However... if you use GameplayKit, you can use Entities, and then think in much the same way you would in Unity about composition and the game loop.

Upvotes: 2

Related Questions