Created
January 25, 2014 02:02
-
-
Save boredzo/8610674 to your computer and use it in GitHub Desktop.
Crash-O-Matic banner layer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CATextLayer *crashOMaticLayer = [CATextLayer new]; | |
CGColorRef color = CGColorCreateGenericRGB(1.0, 0.0, 0.0, 1.0); | |
crashOMaticLayer.backgroundColor = color; | |
CGColorRelease(color); | |
crashOMaticLayer.foregroundColor = CGColorGetConstantColor(kCGColorWhite); | |
crashOMaticLayer.string = @"Special Crash-O-Matic Ed."; | |
crashOMaticLayer.alignmentMode = kCAAlignmentCenter; | |
crashOMaticLayer.fontSize = 18.0; | |
//Your coordinates may vary. | |
NSSize size = { 300.0, 20.0 }; | |
crashOMaticLayer.bounds = (NSRect){ NSZeroPoint, size }; | |
crashOMaticLayer.zPosition = +1.0; | |
crashOMaticLayer.contentsScale = 2.0; | |
[_rootLayer addSublayer:crashOMaticLayer]; | |
crashOMaticLayer.frame = (NSRect){ { -70.0, +70.0 }, size }; | |
[crashOMaticLayer setValue:@(-M_PI_4) forKeyPath:@"transform.rotation.z"]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment