Git Product home page Git Product logo

fbglowlabel's Introduction

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.

Blue White

These are not so bad, but somehow cheap. Then, see following image which is with inner glow.

InnerGlow

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.

LCDFont

FOR MORE DETAIL

This repository includes demo project, so you can dig into it for more detail.

fbglowlabel's People

Contributors

lyokato avatar

Watchers

James Cloos avatar 时点软件冯成林 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.