您的位置:首页 > 移动开发 > Cocos引擎

cocos2d 中用 图片数字 作为 Lable 显示

2013-07-30 11:10 274 查看






LabelAtlas

abelAtlas





Introduction

CCLabelAtlas
was the 1st fast label added into cocos2d. But it was superseded by
CCBitmapFontAtlas
.It is being maintained for backwards compatibility, but you should use
CCBitmapFontAtlas
instead.

Creating a LabelAtlas

CCLabelAtlas *label = [CCLabelAtlas labelAtlasWithString:@"Hello World" charMapFile:@"tuffy_bold_italic-charmap.png" itemWidth:48 itemHeight:64 startCharMap:' '];
[self add:label];


charMapFile
is an image file that contains all the characters. Each character should be ordered according to its
ASCII value and the image can't contain more than 256 characters.

itemWidth
is the width of the characters in pixels

itemHeight
is the height of the characters in pixels

startCharMap
is the first character of the map.

http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:labels
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: