gpt4 book ai didi

objective-c - 在iPhone上以增加lineWidth绘制线

转载 作者:行者123 更新时间:2023-12-01 17:00:02 25 4
gpt4 key购买 nike

我正在通过在CALayer上绘制路径来在iOS上画一条线。如何用增加的lineWidth(笔划宽度)描边此线,以使该行的左端比右端细? (因为我要使用strokeEnd属性,所以它实际上必须是直线,而不是形状或闭合路径。)

谢谢您的帮助!

最佳答案

使用绘图功能。刚开始习惯会很烦人,但是它确实可以做到。如果您需要其他帮助,请发表评论

-(void)draw{
float lineHeight = 5;//change this as you see fit, like set it equal to an incrementing/decrementing variable of your choice...
glEnable(GL_LINE_SMOOTH);
glLineWidth(lineHeight); // change this as you see fit
glColor4ub(255,255,255,255); // change these as you see fit :)
ccDrawLine(ccp(10,310), ccp(30,310)); // these numbers are probably off, you'll have to mess with these to get it in the right position :)
[super draw];
}

关于objective-c - 在iPhone上以增加lineWidth绘制线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7930713/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com