加载及替换字体插件
请自行定义gamefont.css里的@font-face,不会css的就自个儿学。JAVASCRIPT 代码下载
//=============================================================================
// Fonts.js
//=============================================================================
/*:
* @plugindesc Change game default fonts and waiting fonts to load
* @author 0nepeop1e
*
* @param Bitmap Font
* @desc Default font face used for bitmap in game.
* @default GameFont
*
* @param Window Font
* @desc Default font face used for window in game.
* @default GameFont
*
* @param Fonts
* @desc List of font face definded in gamefont.css, seperate with ';'
* @default GameFont
*/
(function(pm){
ft = {};
ft.bitmapFont = pm.parameters('Fonts')["Bitmap Font"] || "GameFont";
ft.windowFont = pm.parameters('Fonts')["Window Font"] || "GameFont";
ft.fontsList = (pm.parameters('Fonts')["Fonts"] || "GameFont").split(";");
Scene_Boot.prototype.isGameFontLoaded = function(){
var loaded = Graphics.isFontLoaded(ft.fontsList);
for(var i = 1; i < ft.fontsList.length; i++)
loaded = loaded && Graphics.isFontLoaded(ft.fontsList);
if(loaded){
returntrue;
}else{
var elapsed = Date.now() - this._startDate;
if(elapsed >= (20000 * ft.fontsList.length)){
thrownew Error('Failed to load Fonts');
}
}
};
ft._initBitmap = Bitmap.prototype.initialize;
Bitmap.prototype.initialize = function(){
ft._initBitmap.apply(this, arguments);
this.fontFace = ft.bitmapFont;
};
Window_Base.prototype.standardFontFace = function(){
return ft.windowFont;
};
})(PluginManager);
本帖来自P1论坛作者英顺的马甲,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:https://rpg.blue/forum.php?mod=viewthread&tid=384664若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。
页:
[1]