HEre是我的绘画方法..在ios6 / 7& iPhone3 / 4/5模拟器,但我的iphone 5s的线路更薄..我将线宽增加到100但没有工作,但如果我减少它,它的工作原理!这是一个cocos2d v2.1项目。
-(void) draw
{
glEnable(0x0B20);
ccDrawColor4F(0.22f, 0.82f, 0.00f, 1.00f);
glLineWidth([[UIScreen main] scale] == 2 ? 32 : 16);
ccDrawLine(ccp(0, 0), ccp(0, [[arr objectAtIndex:0] intValue]));
ccDrawLine(ccp(0, size.height), ccp(0, size.height - [[arr objectAtIndex:0] intValue]));
for(int x = 0; x <= (size.width / 16); x++)
{
ccDrawLine(ccp(x*16 - offset, 0), ccp(x*16 - offset, [[arr objectAtIndex:x] intValue]));
ccDrawLine(ccp(x*16 - offset, size.height), ccp(x*16 - offset, size.height - [[arr objectAtIndex:x] intValue]));
}
}