-1
나는 알파벳 문자 8x8 행렬을 가졌습니다. 나는이 문제를 극복하기 위해 레이블을 터치하고 이동할 때, 문자를 8x8 매트릭스.터치가 cocos2d에서 움직일 때 CCLabelTTF 스프라이트에서 유일한 문자를 얻는 방법
-(void)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch *touch=[touches anyObject];
CGPoint newlocation=[touch locationInView:[touch view]];
newlocation=[[CCDirector sharedDirector] convertToGL:newlocation];
for (int i=0; i<GRID_WIDTH; i++) {
for (int j=0; j<GRID_HEIGHT; j++) {
if (CGRectContainsPoint([grid[i][j].letter boundingBox],newlocation)) {
CCLOG(@"letters %@",[grid[i][j].letter string]);
[letterarray addObject:[grid[i][j].letter string]];
}
}
}
}
무슨 문제입니까? 귀하의 질문을 명확히하십시오. – YvesLeBorg
I 해요 같이, 경계 상자를 통해 터치를 이동할 때 반복 편지를 받고 : B에게 B B W W W W W W W W W I I을 –