Guilloche 在 UIViews 中创建Guilloch\u00e9 图案。它主要基于 Tom Beddard 的 AS3 源代码和 Guilloche Pattern Generator。我们使用它来为每副牌生成独特的背面。
** 在示例应用中,单次点击 GuillocheView 将切换全屏查看。 **
#import 'GuillocheView.h'
GuillocheView *guillocheView = [[GuillocheView alloc] initWithFrame:self.view.frame]; // Creates a full view Guilloche pattern with default values
[self.view addSubview:guillocheView]; // add to the current view
GuillocheView 支持以下属性
float scale;
float steps;
float multiplier;
float majorRipple;
float minorRipple;
float radius;
float opacity;
float lineThickness;
NSArray *lineColors;
当其任何属性更改时,视图将实时更新。
guillocheView.scale = 3.0; // guillocheView re-renders automatically
类不会自动执行调整大小,但这样做非常简单
// init
GuillocheView *guillocheView = [[GuillocheView alloc] initWithFrame:self.view.frame];
[self.view addSubview:guillocheView];
// update size to full width, 100px wide
guillocheView.frame = CGRectMake(0.0, 0.0, self.view.frame.size.width, 100.0);
// re-render
[guillocheView setNeedsDisplay];
请在这里发送拉取请求。