[]如何同时加载多个bmfont字体
代码如下 加载单个bmfont是没有问题的,当加载多个bmfont会报错
Constant.bmfont = new BitmapFont;
Constant.bmfont.loadFont(["res/bmfont/123font.fnt", "res/bmfont/critdamage.fnt", "res/bmfont/enemydamage.fnt"
,"res/bmfont/cure.fnt", "res/bmfont/selfdamage.fnt", "res/bmfont/specialfont.fnt"], new Handler(this, this.loadbmfont));
private function loadbmfont():void{
Text.registerBitmapFont("123font", Constant.bmfont);
Text.registerBitmapFont("critdamage", Constant.bmfont);
Text.registerBitmapFont("enemydamage", Constant.bmfont);
Text.registerBitmapFont("cure", Constant.bmfont);
Text.registerBitmapFont("selfdamage", Constant.bmfont);
Text.registerBitmapFont("specialfont", Constant.bmfont);
}
Constant.bmfont = new BitmapFont;
Constant.bmfont.loadFont(["res/bmfont/123font.fnt", "res/bmfont/critdamage.fnt", "res/bmfont/enemydamage.fnt"
,"res/bmfont/cure.fnt", "res/bmfont/selfdamage.fnt", "res/bmfont/specialfont.fnt"], new Handler(this, this.loadbmfont));
private function loadbmfont():void{
Text.registerBitmapFont("123font", Constant.bmfont);
Text.registerBitmapFont("critdamage", Constant.bmfont);
Text.registerBitmapFont("enemydamage", Constant.bmfont);
Text.registerBitmapFont("cure", Constant.bmfont);
Text.registerBitmapFont("selfdamage", Constant.bmfont);
Text.registerBitmapFont("specialfont", Constant.bmfont);
}
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
182*****369
赞同来自: