Skip to content

carddeck/guilloche

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Guilloche

Guilloche creates Guilloché Patterns in UIViews. It's based heavily on Tom Beddard's AS3 source code and Guilloche Pattern Generator. We use it to generate unique backs for each deck of cards.

In the example application, single tapping on the GuillocheView will toggle full-screen viewing. Long pressing will save the current Guilloche to the Photo Library.

Usage


#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

Attributes

GuillocheView supports the following attributes:

float scale;
float steps;
float multiplier;
float majorRipple;
float minorRipple;
float radius;
float opacity;
float lineThickness;
NSArray *lineColors;

The view updates live when one of its attribute properties changes.

guillocheView.scale = 3.0; // guillocheView re-renders automatically

Resizing

Resizing is not performed automatically by the class, however it's very easy to do:

// 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];

Screenshots

Example App Default Full Screen Alternative Example Alternative Example 2

Contributing

Send me Pull Requests here, please.