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
1
vote
1 answer

CCLabelTTF::setString not accepting white space at start and end of string

I'm trying to set value of a label in cocos2d-x. It's not showing spaces if I add them on start or end of string, like label->setString("10 10"); working correctly. But if I use label->setString(" 10"); label->setString("10 "); it only show "10"…
Nargis
  • 739
  • 7
  • 30
1
vote
2 answers

Cocos2d-x CClabelTTF invisible

In my game I use cclabelttf to display the score the player made. It was working fine back in the end of July, I've changed nothing in my code, but there was a: - IOS upgraded (6.1 to 7.0) - OSX updated - cocos2d-x - Xcode update I'm not using…
Ferenc Dajka
  • 1,052
  • 3
  • 17
  • 45
1
vote
2 answers

Importing fonts for cocos2dx iOS

I've referred to this link: Using custom fonts in Cocos2d and this link : http://captainjor.wordpress.com/2013/04/03/cocos2d-x-custom-ttf-font/ The first link works but I can only specify the family name of the font (Name based on the top of the…
Joel Tay
  • 83
  • 1
  • 9
1
vote
1 answer

How to create a stroke on a CCLabelTTF

I have been looking for the past couple of hours for a way to create a stroke around labels in cocos2d but so far all I have come up with is this: CCLabelTTF Font Stroke Demo this is just what I need but the stroke looks very blocky, and I am…
Stephen
  • 499
  • 9
  • 28
1
vote
1 answer

Cocos2d getChildByTag Not Returning Sprite

I am trying to change the text of a CCLabelTTF in cocos2d xcode (objective-c). I am setting the label like this: CCLabelTTF *progressLBL = [CCLabelTTF labelWithString:@"connecting..." fontName:@"Marker Felt" fontSize:10]; progressLBL.position = ccp(…
Alex Pelletier
  • 461
  • 5
  • 13
1
vote
1 answer

Setting the text of a CCLabelTTF in Cocos2D

I'm trying to create CCLabelTTF where the text changes as the story progresses, but I'm having trouble setting a simple piece of text to it. The label currently displays (null) and I can't seem get it to display "This is text". NSLog returns it…
1
vote
2 answers

How do i remove the hover scale on CCMenuItemLabel?

I have a CCMenuItemLabel on my scene, and when I press and hold my finger on the label it grows in size. Now I dont want that and I dont know how to do this. I've searched for cocos2d ccmenuitemlabel hover but didnt find what I was searching for.
Arbitur
  • 38,684
  • 22
  • 91
  • 128
1
vote
3 answers

CCLabelTTF Text Alignment

I have a class which mimics a button. It contains one label, which I'm trying to align centrally (horizontally). No matter what I try, the label stays on the left hand side, leading me to think this is more complicated than it seems. Here's the only…
Echilon
  • 10,064
  • 33
  • 131
  • 217
0
votes
1 answer

cc.LabelTTF: spacing between characters

Is there a way to change a space between characters? Some ttf font strings look very compressed. The maximum closest thing I've managed to find is cc.FontDefinition But it doesn't look like it contains anything specific I need.
heximal
  • 10,327
  • 5
  • 46
  • 69
0
votes
0 answers

setting up cocos2d CCBitmapFontAtlas for arabic font android

i am stuck at getting an arabic fnt and png file(bitmap font style ) which i have created with Hiero bitmap font tool to work with my cocos2d android game. i am replacing this line "CCBitmapFontAtlas selectgame = CCBitmapFontAtlas.bitmapFontAtlas (…
0
votes
1 answer

Cocos2d-x CCLabelTTF enableStroke is time consuming

We're developing iOS application and encountered a problem with labels' outlines. It seems, that creating outlines(for 20-30 labels) takes more time now, than anything else. The creating lag is about 2-3 seconds, what is too long. Can anyone say…
0
votes
1 answer

How to create a score label with roll numbers in cocos2d?

I'm trying to create a score using a CCLabelTTF to show the score on the screen. But I would display the score scrolling numbers until they arrive at the final score. I make this in update method : if(currentScore < finalScore) { …
swifferina
  • 293
  • 4
  • 16
0
votes
1 answer

CCLabelTTF set automatically the font size

Is there a way to set automatically the font size of a CCLabelTTF text in base of the length of the string? because I have a number that increment and if it gets too big collides with a close image...
swifferina
  • 293
  • 4
  • 16
0
votes
2 answers

Displaying two different types of variables in one label string

I am trying to make a CCLabelTTF display a string and an integer together. Like this: Your score is 0. I've tried a few things but I usually get the warning Data argument not used by format string, and the label doesn't output the correct…
Albert K
  • 25
  • 7
0
votes
1 answer

Cocos2D V3.0 crash CCLabelTTF

I am converting my project from using Cocos2D v2.1 to V3.0. It's a UIKit project with Cocos2D added as a sub-project and the director loaded lazily in a couple of viewcontrollers. I managed to get rid of all the compiler warnings, it runs fine and…
user1459524
  • 3,613
  • 4
  • 19
  • 28