objective c - sprite kit physicsBody around circles -


so guy , girls got sprite , wounding how create circle physics body around it. maybe using alpha.

what have ball.physicsbody = [skphysicsbody bodywithrectangleofsize:ball.size];

bodywithrectangleofsize puts square on sprite right?

to create circular physics body can either use:

mynode.physicsbody = [skphysicsbody bodywithcircleofradius:10.0]; 

or

mynode.physicsbody = [skphysicsbody bodywithcircleofradius:10 center:cgpointmake(0, 0)]; 

you specify center if looking physics body have offset node's center.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -