Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*:
- * @plugindesc v1.00 Allows you to add any number of additional fonts to the game, mapped by their file name.
- * <Iavra Fonts>
- * @author Iavra
- *
- * @param Fonts
- * @desc Comma-separated list of all fonts to be loaded, relative to the project folder.
- * @default
- *
- * @help
- * The plugin parameter "Fonts" needs to contain a list of all fonts you want to use, relative to the project
- * folder. They will be mapped according to their file name.
- *
- * So, assuming you want to use the files "fonts/test.ttf" and "fonts/subfolder/test2.otf", the plugin parameter
- * would look like this:
- *
- * fonts/test.ttf, fonts/subfolder/test2.otf
- *
- * The fonts would be available as "test" and "test2" inside the game, ready to use.
- */
- (function($, undefined) {
- "use strict";
- var _params = $plugins.filter(function(p) { return p.description.contains('<Iavra Fonts>'); })[0].parameters;
- var _param_fonts = _params['Fonts'].trim().split(/\s*,\s*/).filter(function(f) { return !!f; });
- var alias_initialize = $.initialize;
- $.initialize = function() {
- alias_initialize.call(this);
- for(var i = 0, font; font = _param_fonts[i++]; ) { Graphics.loadFont(/([^\/]+)\..*$/.exec(font)[1], font); }
- };
- })(SceneManager);
Add Comment
Please, Sign In to add comment