Created
May 15, 2012 00:20
-
-
Save colinta/2698242 to your computer and use it in GitHub Desktop.
glowing custom font
This file contains hidden or 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
| # from BubbleWrap | |
| def rgba_color(r, g, b, a=1) | |
| UIColor.colorWithRed((r/255.0), green:(g/255.0), blue:(b/255.0), alpha:a) | |
| end | |
| class MyApplicationController < UIViewController | |
| def viewDidLoad | |
| font = UIFont.fontWithName('Inconsolata', size:20) | |
| color = rgba_color(255, 255, 255) | |
| @label = UILabel.new | |
| @label.font = font | |
| @label.textColor = color | |
| @label.text = 'Example text' | |
| @label.frame = [[0, 0], [320, 30]] # play with this frame size, i'm making these numbers up | |
| @label.setBackgroundColor(UIColor.clearColor); | |
| shadow_color = rgba_color(200, 200, 255) | |
| @label.layer.shadowColor = shadow_color.CGColor; | |
| @label.layer.shadowOffset = [2, 2]; | |
| @label.layer.shadowRadius = 2.0; | |
| @label.layer.shadowOpacity = 1.0; | |
| @label.layer.masksToBounds = false; | |
| view.addSubview(@label) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment