Questions tagged [cclabelttf]

CCLabel is a Cocos2d class, subclass of CCTextureNode that knows how to render text labels

CCLabel is a Cocos2d class, subclass of CCTextureNode that knows how to render text labels

Complete information

Class Source

48 questions
15
votes
1 answer

iOS. Cannot run a project after updating cocos2d library inside this project

It cannot compile sources and writes: Undefined symbols for architecture i386: "_CTFontManagerRegisterFontsForURL", referenced from: -[CCLabelTTF getFontName:] in CCLabelTTF.o ld: symbol(s) not found for architecture i386 clang: error:…
Gargo
  • 1,135
  • 1
  • 10
  • 21
11
votes
1 answer

How can I add a font to my Cocos2D iOS project and use it with a CCLabelTTF?

I need to use a custom font with my Cocos2D project. I've tried a few techniques, but Cocos2D keeps reporting: Unable to load font XXX.ttf Why can't I get my custom font to work with with Cocos2D? ADDITIONAL INFORMATION This is a…
RLH
  • 15,230
  • 22
  • 98
  • 182
6
votes
2 answers

Trying to set up a CCLabelTTF with an integer as part of it's string in Cocos2d-X C++

So in Objective-C with Cocos2d, I'd use a NSMutableString with format to put a variable (score) into a string. I'd take that string and use a CCLabel to place it on the screen. Using Cocos2D-x, I'm having trouble finding a way to get this result. A…
David Small
  • 581
  • 1
  • 10
  • 25
5
votes
1 answer

cocos2d-x Design Size feature and blurry CCLabelTTF

I had a project with CCLabelTTF looking sharp and good. When I started to use the design size feature to fix some issues appeared with different device sizes, and retina displays, all fonts started to look blurry. I saw an answer in the following…
Abdalla
  • 2,071
  • 2
  • 16
  • 27
5
votes
2 answers

CCLabelTTF not working in iOS 6.1

I am using cocos2d v0.99.5 and iOS deployment target is 5.0 when i run my app with Xcode 5.0 in iOS-7.0/5.0 simulator it is working fine. and i run with Xcode 5.0 in iOS-6.1/6.0 simulator not working. i checked with breakpoint, it is crashing at…
Hari Babu
  • 891
  • 1
  • 9
  • 22
4
votes
3 answers

How do I prevent custom font in Cocos2d from appearing cut off

I am using a custom font called KomikaTitle. In some cases the font appears cut off on the left in the first character. This doesn't happen when I use a native font such as Arial. The following is the code I am using: scoreDisplayLabel =…
AbhinavVinay
  • 303
  • 6
  • 18
2
votes
0 answers

How To Implement Rich Text in CocosSharp?

Is there a good way to implement Rich Text using the existing CCLabel class or another class? I'ma ttempting to render something like the image below I wasn't able to find any information in the guides on rich text, the wiki entry on CCLabel…
Noah Callaway
  • 617
  • 5
  • 16
2
votes
0 answers

Emoji Monotoned in CCLabelTTF

I am using cocos2d-iphone in objective-c. When I use CCLabelTTF to show text, if there are emojis in the text they are also colored to the color of the text and that's not what I want. However when I use UITextView, emojis are good. No matter what…
Chris Liu
  • 79
  • 7
2
votes
0 answers

Is there a way to use a colorWithPatternImage with the CCLabelTTF?

I tried the following: UIColor *c = [UIColor colorWithPatternImage: [UIImage imageNamed: @"gradient.png"]]; CCColor *cc = [CCColor colorWithUIColor: c]; lblLevelName = [CCLabelTTF labelWithString: @"Level" fontName: @"" fontSize:…
Leonardo
  • 21
  • 1
2
votes
1 answer

Custom fonts with CCLabelTTF on Cocos2d-x (XCode) not working

I have a problem when using custom fonts, I have made everything this link (http://www.cocos2d-x.org/wiki/How_to_Use_Custom_TTF_Font_on_iOS) says. I've looked the answers here and nothing works. Things I've done: *Load the Font.ttf into XCode *Add…
mtet88
  • 524
  • 6
  • 21
2
votes
0 answers

Why sizeWithFont: and sizeWithAttributes: return different values?

I have CCLabelTTF with NSString text. On the 5th IOS sizeWithFont: returns height bigger then sizeWithAttributes: on the 7th. if ([[[UIDevice currentDevice] systemVersion] compare:@"7.0" options:NSNumericSearch] == NSOrderedAscending) { dim =…
eilas
  • 373
  • 6
  • 17
2
votes
2 answers

CCLabelTTF SetString not Updating

I'm using a CCLabelTTF to show the score of the player on the screen. However, when I'm calling setString to update the score label, it doesn't update (so it always stays at 0). Here's my code : In Player.m, I initiate a new PlayerHUD object: -…
2
votes
1 answer

Special Characters in Cocos2D-X CCLabelTTF

Hi I want to create CCLabelTTF with a string that contains special characters here is some example CCLabelTTF* pLabelDuracion = CCLabelTTF::create("Duración de Periodo", "Arial", 20,CCSize(),kCCTextAlignmentLeft); or CCLabelTTF* pLabelPsswd =…
magorich
  • 449
  • 5
  • 17
1
vote
0 answers

CCLabelTTF universal device issue

I have a CCLabelTTF on a CCNodeColor that will scroll across the screen. My problem is that it looks perfect on iPad Mini,iPhone 4,5,6 and completely wrong on iPhone6+,iPad Air, iPad Retina. I've changed the contentSizeType and nothing changed. The…
Asdrubal
  • 2,421
  • 4
  • 29
  • 37
1
vote
0 answers

Cocos2d Scaling Issue

I am running a Cocos2d v3 game on xcode 6. After making some changes like adding more nodes in the code and cleaning the build. The scaling of the images and CCLabelTTF changed on a physical device to significantly smaller. After not figuring out…
Asdrubal
  • 2,421
  • 4
  • 29
  • 37
1
2 3 4