望着調試抽獎代碼,我發現這一點:
#if CC_SPRITE_DEBUG_DRAW == 1
// draw bounding box
CGPoint vertices[4]={
ccp(_quad.tl.vertices.x,_quad.tl.vertices.y),
ccp(_quad.bl.vertices.x,_quad.bl.vertices.y),
ccp(_quad.br.vertices.x,_quad.br.vertices.y),
ccp(_quad.tr.vertices.x,_quad.tr.vertices.y),
};
ccDrawPoly(vertices, 4, YES);
#elif CC_SPRITE_DEBUG_DRAW == 2
// draw texture box
CGSize s = self.textureRect.size;
CGPoint offsetPix = self.offsetPosition;
CGPoint vertices[4] = {
ccp(offsetPix.x,offsetPix.y), ccp(offsetPix.x+s.width,offsetPix.y),
ccp(offsetPix.x+s.width,offsetPix.y+s.height),
ccp(offsetPix.x,offsetPix.y+s.height)
};
ccDrawPoly(vertices, 4, YES);
#endif // CC_SPRITE_DEBUG_DRAW
看起來你也許可以讓你從精靈的quad
財產想要什麼。或者,也許它的第二個解決方案,因爲我不知道什麼被這裏的邊框和紋理箱的Cocos2D手段。
我已經花了,而與此周圍碴,至今有運氣不佳,這就是爲什麼我結束在這裏張貼希望有一個簡單的解決方案...欣賞提示,但! –