0

如何在 GameConfig.h 中存储 CCLabelTTF 颜色,例如:

#define kGameLabelColor ccc3(79,71,59);
4

1 回答 1

5

Define it in GameConfig.h, without the ; in the end:

#define kGameLabelColor ccc3(79,71,59)

To use it:

#import "GameConfig.h"

...

[label setColor:kGameLabelColor];

If you want to change the color of all your labels in the whole app by default, I think you may consider modifying initWithString method in CCLabelTTF.m, adding color_ = ccc3(79,71,59);.

于 2012-04-25T15:42:26.510 回答