This is an example script from RPG Maker MV, taken from http://www.rpgmaker-mv.com/javascript-not-java/ by Hudell at RMWeb.
- /*
- * @param Width
- * @desc japanese text
- * @default 240
- * @param Background
- * @desc japanese text
- * @default 0
- * @help japanese text
- */
- (function() {
- var parameters = PluginManager.parameters['TitleCommandPosition'];
- var offsetX = Number(parameters['Offset X'] || 0);
- var offsetY = Number(parameters['Offset Y'] || 0);
- var width = Number(parameters['Width'] || 240);
- var background = Number(parameters['Background'] || 0);
- var _Window_TitleCommand_updatePlacement = Window_TitleCommand.prototype.updatePlacement;
- Window_TitleCommand.prototype.updatePlacement = function() {
- _Window_TitleCommand_updatePlacement.call(this);
- this.x = offsetX;
- this.y = offsetY;
- this.setBackgroundType(background);
- };
- Window_TitleCommand.prototype.windowWidth = function() {
- return width;
- };
- })();
Expand to see the code.