FBGlowLabel
This library allows you to provide labels with glowing effect easily.
There are some other tutorials or libraries to support glowing effect. But most of them support only outer glow simply using shadow features of CoreGraphics. Sometime people may feel it's cheap. To make it not cheap, the most important essence is inner glow
See following images, these two use only outer glow.
These are not so bad, but somehow cheap. Then, see following image which is with inner glow.
Perfect!
SETTING UP
If you use CocoaPods, add following line into your Podfile
pod 'FBGlowLabel', :git => 'https://github.com/lyokato/FBGlowLabel.git'
or directly git clone or download from this page.
IMPLEMENTATION
Most of the usage is same as UILabel. And you can set just 4 more properties. too simple.
- glowColor
- glowSize
- innerGlowColor
- innerGlowSize
#import <FBGlowLabel/FBGlowLabel.h>
- (void)setupLabel
{
CGRect frame = CGRectMake(10, 100, 300, 100);
FBGlowLabel *v = [[FBGlowLabel alloc] initWithFrame:frame];
v.text = kInitialText;
v.textAlignment = NSTextAlignmentCenter;
v.clipsToBounds = YES;
v.backgroundColor = [UIColor clearColor];
v.font = [UIFont fontWithName:@"Helvetica-Bold" size:40];
v.alpha = 1.0;
v.textColor = UIColor.whiteColor;
v.glowSize = 20;
v.glowColor = UIColor.greenColor;
v.innerGlowSize = 4;
v.innerGlowColor = UIColor.greenColor;
self.label = v;
[self.view addSubview:v];
}
SEE ALSO
If you want more digital styled text, see FBDigitalFont.
FBDigitalFont supports some kinds of digital styled fonts.
FOR MORE DETAIL
This repository includes demo project, so you can dig into it for more detail.