Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jandrad/CCLabelFX
CCLabelTTF subclass for Cocos2d with blurred shadow support.
https://github.com/jandrad/CCLabelFX
Last synced: about 1 month ago
JSON representation
CCLabelTTF subclass for Cocos2d with blurred shadow support.
- Host: GitHub
- URL: https://github.com/jandrad/CCLabelFX
- Owner: jandrad
- License: mit
- Created: 2011-02-21T05:37:08.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2012-07-24T00:48:56.000Z (over 12 years ago)
- Last Synced: 2023-03-12T03:22:27.525Z (almost 2 years ago)
- Language: Objective-C
- Homepage:
- Size: 699 KB
- Stars: 50
- Watchers: 4
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE
Awesome Lists containing this project
- awesome - CCLabelFX - CCLabelTTF subclass for Cocos2d with blurred shadow support. (etc)
- awesome - CCLabelFX - CCLabelTTF subclass for Cocos2d with blurred shadow support. (etc)
README
CCLabelFX
==================CCLabelTTF subclass for Cocos2d with blurred shadow support.
![](http://img51.imageshack.us/img51/7784/img0845.png)
Usage
-----------------------Add the CCLabelFX folder to your project. Import "CCLabelFX.h" where needed.
Example:
ccColor4B shadowColor = ccc4(255,0,0,255);
ccColor4B fillColor = ccc4(0,0,255,255);
CCLabelFX *label1 = [CCLabelFX labelWithString:@"Testing Labels with shadows"
fontName:@"Marker Felt"
fontSize:30
shadowOffset:CGSizeMake(-2,-2)
shadowBlur:2.0f
shadowColor:shadowColor
fillColor:fillColor];See CCLabelFX.h ways to create a CClabelFX, also check out the sample project.
Warnings
-----------------------* Since CCLabelFX is a subclass of CCLabelTTF it is expensive to create.
* Setting the shadow color, fill color and string is as expensive as creating a new one.
* When using large text with wrapping, make sure you don't use too much blur or a big shadow offset. It will generate unexpected results.
* Don't handle the CCLabelFX color with the color property. Instead, set the fill color.That's it, I hope you find it useful. Suggestions and corrections are always welcome.