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
0
votes
0 answers

Cocos2D and UTF-8 (german characters)

I have a .xml file containing some text. The text also has some German charcters (ä, ü, ö) in it. The XML file is encoded as UTF-8, wich makes it appear fine in every text editor and xcode. But when showing the text on a Cocos2D CCLabelTTF…
Boris
  • 8,551
  • 25
  • 67
  • 120
0
votes
2 answers

constructor of CCLabelTTF in cocos2d v3.0

I read this document and declare like that: CCLabelTTF *label = [CCLabelTTF initWithString: @"a" fontName: @"HelveticaNeue" fontSize: 24 dimensions: CGSizeMake(320,480) hAlignment: CCVerticalTextAlignmentTop]; but its show warning: no know class…
Sunary
  • 121
  • 1
  • 14
0
votes
1 answer

Set position of CCLabelTTF in CCNode and add to CCScene [cocos2d v3]

I'm having trouble understanding what is going on here. I currently have a "Header" class that inherits from CCNode. This CCNode class has multiple properties including CCSprite's and CCLabelTTF's. In the init, I create these objects and set their…
SpellChucker
  • 450
  • 5
  • 18
0
votes
1 answer

Reduce Line Spacing CClabelTTF font cocos2d-x

Hi i'm facing problem in adjusting spacing between lines in cocos2d-x using cclabelttf . i just want to make sure that do we have any property to change line spacing in cocos2d-x
0
votes
2 answers

Update Score Cocos2d 3.0

Ive been trying to figure out how to update the score. I have an label with a string that the score goes on but it doesn't update This is the label with the score thats suppose to update score=0; CCLabelTTF *scorelabel = [CCLabelTTF…
Crazycriss
  • 315
  • 1
  • 5
  • 19
0
votes
1 answer

Cocos2d: How to Align CCLabelTtf vertically with different font size?

How to aligh two CCLabelTtf vertically with different font size? Thanks This is how I am creating labels: for (int i = 0; i < 5; i++) { CCLabelTTF *label = [CCLabelTTF labelWithString:@"11km 90m" fontName:@"Limelight.ttf" fontSize:20]; …
Vervatovskis
  • 2,277
  • 5
  • 29
  • 46
0
votes
2 answers

CCLabelTTF invisible issue in iOS 7.0

I'm using cocos2d-x 2.0.4 for my game. CCLabelTTF works well on both of device and simulator in iOS 6. But when i test it in iOS 7.0, it doesn't work. Here is my code. int nScore = 10; char str[50]; sprintf(str, "SCORE : %d",…
0
votes
2 answers

CCLabelTTF multiline label not working

I am trying to create a multiline label in cocos2d 1.0 using CCLabelTTF. I have tried the examples that I have come across, but none seem to work. Here is what I have CCLabelTTF *storeLabelHeading = [CCLabelTTF labelWithString:@"Here is a really…
JeffB6688
  • 3,782
  • 5
  • 38
  • 58
0
votes
1 answer

CCLabelTTF incorrectly positioned

I am having some trouble with cocos2dx (windows-ver. cocos2d-1.0.1-x-0.12.0) CCLabelTTF. Whichever label having string-with-spaces, the label is moving upwards by few pixels. Here is the basic code I used to display two labels (with and without…
0
votes
1 answer

Trying to fade out CCLabelTTF, change text, and then fade back in

I am trying to make CCLabelTTF change its text every 10 seconds using an array of strings. This is the code I have so far, but it is giving me this error! 2013-09-07 15:47:34.618 MazeIt[6271:1b503] -[TitleLayer opacity]: unrecognized selector sent…
0
votes
2 answers

Displaying some text on the screen using the Framework Cocos2D

I want to display a text on the screen using the framework Cocos2D. I'm thinking off using the draw method. But I don't know the exact way of doing that. I would be glad if anyone could help me on this topic.
Rocker
  • 1,467
  • 5
  • 14
  • 20
0
votes
1 answer

CCLabelBMFont loses tailing characters for each newline characters

creating a label this style : CCLabelBMFont *label1_= [CCLabelBMFont labelWithString:@"description: -" fntFile:@"comicsans.fnt" width:270 alignment:kCCTextAlignmentLeft]; and: [label1_ setString: @"someText\n and some newline \nand another new line…
Zen Of Kursat
  • 2,672
  • 1
  • 31
  • 47
0
votes
2 answers

Nice way of tweening CCLabelTTF?

Is there something to tween the font size CCLabelTTF in a nice way? I guess using CCScaleTo does not really recreate the font every iteration now does it?
Jonny
  • 15,955
  • 18
  • 111
  • 232
0
votes
1 answer

Attributed labels in Cocos2d

How can I create an attributed label in Cocos2d? Specifically I'm looking for a label where the color of each word can be unique. I read about ZAttributed string however the Github page no longer exists. Also searching the Cocos2d v2.1-beta2…
SundayMonday
  • 19,147
  • 29
  • 100
  • 154
0
votes
1 answer

RIght-align and position a CCLabelTTF

I would expect the following code to position the label at the upper right of the screen. However the x position appears off to the right of the screen and I have to manually move it way over. What is wrong with this code? CGSize winSize =…
soleil
  • 12,133
  • 33
  • 112
  • 183