CGRect with an angle
问题 I have a line, which is a sprite made by using this code CGPoint diff = ccpSub(startLocation, endLocation); float rads = atan2f( diff.y, diff.x); float degs = -CC_RADIANS_TO_DEGREES(rads); float dist = ccpDistance(endLocation, startLocation); CCSprite *line = [CCSprite spriteWithFile:@"line.png"]; [line setAnchorPoint:ccp(0.0f, 0.5f)]; [line setPosition:endLocation]; [line setScaleX:dist / line.boundingBox.size.width]; [line setRotation: degs]; line.tag = 1; [_lines addObject:line]; [self