Wednesday, 15 September 2010

How to get CGRect of a wheel in spriteMoveFinished method in Cocos2d-android? -



How to get CGRect of a wheel in spriteMoveFinished method in Cocos2d-android? -

i developing game using cocos2d, problem facing while getting cgrect of wheel have placed @ anchor points(0.5,0.5) , position @ win-size width/2-height/2.i detecting touch on wheel , facing problem in using cgrect.intersects(cgrect a,cgrect b).

i trying wheel cgrect positions

cgrect wheelrect=cgrect.make(wheel.getposition().x-(wheel.getcontentsize().width), wheel.getposition().y-(wheel.getcontentsize().height), wheel.getcontentsize().getwidth(), wheel.getcontentsize().getheight());

i getting cgrect of left half of wheel, need observe touch on whole wheel.

i using intersect method of cgrect follow intersect points.

need help.thanks in advance.

is there boundingbox method or property? if utilize that.

anyway issue subtract contentsize position, need multiply contentsize anchorpoint (ie half contentsize) before subtracting it.

android cgrect cocos2d-android

No comments:

Post a Comment