Label font and color

Posted in General by Thanh Bui Wed Feb 03 2016 10:46:24 GMT+0000 (UTC)·10·Viewed 592 times

I put my font in "fonts" folder and this I my code var menuItemPlay = new cc.MenuItemSprite( new cc.LabelTTF("Start!","fonts/after_shok.ttf", 24), // normal state image new cc.Sprite(res.start_s_png), // selected state image this.onPlay, this); the font has no effect on the label. Am I doing anything wrong ? and how do we change the color of the label ?
Frahaan Hussain
Feb 3, 2016

Do you get anything in the console/log?

Thanh Bui
Feb 3, 2016

no, I didn't get anything, no errors

Frahaan Hussain
Feb 3, 2016

Weird, try a different font file

Thanh Bui
Feb 3, 2016

yeah I tried that, didn't help, I also put the font file to the parent folder and tried againnew cc.LabelTTF("Start!","after_shok.ttf", 24)" but nothing happen, the font of the label is just like default

Frahaan Hussain
Feb 3, 2016

Have you followed our video tutorial on this topic?

Thanh Bui
Feb 3, 2016

yes I have just checked from your video and the problem still remains

Frahaan Hussain
Feb 3, 2016

What version of Cocos are you using?

Thanh Bui
Feb 3, 2016

it is 3.10

Thanh Bui
Feb 3, 2016

i'm sorry, my mistake, it is 3.9 not 3.10

Frahaan Hussain
Feb 3, 2016

Try 3.10

  
Markdown is allowed