加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 英顺的马甲 于 2015-10-26 16:21 编辑
请自行定义gamefont.css里的@font-face,不会css的就自个儿学。
//============================================================================= // 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[0]); for(var i = 1; i < ft.fontsList.length; i++) loaded = loaded && Graphics.isFontLoaded(ft.fontsList[i]); if (loaded) { return true; } else { var elapsed = Date.now() - this._startDate; if (elapsed >= (20000 * ft.fontsList.length)) { throw new 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);
//=============================================================================
// 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[0]);
for(var i = 1; i < ft.fontsList.length; i++)
loaded = loaded && Graphics.isFontLoaded(ft.fontsList[i]);
if (loaded) {
return true;
} else {
var elapsed = Date.now() - this._startDate;
if (elapsed >= (20000 * ft.fontsList.length)) {
throw new 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);
|