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!
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.
Most of the usage is same as UILabel. And you can set just 4 more properties. too simple.
#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];
}
If you want more digital styled text, see FBDigitalFont.
FBDigitalFont supports some kinds of digital styled fonts.
This repository includes demo project, so you can dig into it for more detail.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。