ios6 - overlapped ccsprites doesnt responds touch events albeit z-order is bigger -
ccbigsprite , ccsmallsprite classes inherited ccsprite. spr1,spr2 instances of them. cctouchesstart,cctouchesmove,cctouchesend methods overridden protocol cctargetedtouchdelegate both classes.
problem :in normal cases,touch events working expected , works sprite instances, till sprites overlaps. touch events works (ccbigsprite *spr1) if (ccsmallsprite *spr2) touched.
because of overlap issue here , exact position image shown. when press spr2 touch events should work instead of sp1.
how can prepare fatal problem ?
both classes have overridden method same :
-(void)onenter { [super onenter]; [[[ccdirector shareddirector]touchdispatcher]addtargeteddelegate:self priority:self.touchpriority swallowstouches:yes]; }
does sense ?
also: setpriority didnt alter anyhing.
im changing manually.
[spr2 settouchpriority:1];[spr1 settouchpriority:2];//lower meant highest priority or vise versa. didnt help.
this shall cocos2d-iphone 2.0 stable version issue ?
the draw order not influence order of touch events.
if tap on little sprite in above image, order sprites registered cctouchdispatcher determines whether little or big sprite receives first touch events.
ios6 cocos2d-iphone ccsprite overlapping
No comments:
Post a Comment