0
검은 색으로 계속 표시됩니다.CCMotionStreak setColor는 cocos2d 3.1에서 작동하지 않습니다.
- (void)touchBegan:(UITouch *)touch withEvent:(UIEvent *)event
{
[self beginMotionStreak];
}
- (void)touchMoved:(UITouch *)touch withEvent:(UIEvent *)event
{
[self addMotionStreak:[touch locationInWorld]];
}
- (void)touchEnded:(UITouch *)touch withEvent:(UIEvent *)event
{
[self endMotionStreak];
}
- (void)beginMotionStreak
{
CCMotionStreak *streak = [CCMotionStreak streakWithFade:10 minSeg:1.0 width:5.0 color:[CCColor greenColor] texture:nil];
[self addChild:streak z:1 name:@"streak"];
}
- (void)addMotionStreak:(CGPoint)touchLoc
{
CCMotionStreak *streak = (CCMotionStreak *)[self getChildByName:@"streak" recursively:YES];
[streak setColor:[CCColor redColor]];
[streak setPosition:touchLoc];
}
- (void)endMotionStreak
{
[self removeChildByName:@"streak" cleanup:YES];
}
어떤 조언 :
다음은 내 데모 코드? 감사합니다.
대단히 흥미 롭습니다. 감사 – goofansu