Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=============================================================================
- // Map_Bars.js
- //=============================================================================
- //v1.0
- /*:
- * @plugindesc Makes bars yo!
- * @author Jeremy Cannady
- *
- * @param Bar 1 X starting
- * @desc Select x position.
- * @default 0
- *
- * @param Bar 1 Y starting
- * @desc Select the y position.
- * @default 0
- *
- * @param Bar 1 Width
- * @desc Select the width.
- * @default 100
- *
- * @param Bar 1 Height
- * @desc Select the height.
- * @default 50
- *
- * @param Bar 1 color 1
- * @desc Select the color.
- * @default 30
- *
- * @param Bar 1 color 2
- * @desc Select the color.
- * @default 30
- *
- * @help Cool bars!
- *
- */
- (function(){
- var parameters = PluginManager.parameters('Map_Bars');
- var bar1x = parseInt(parameters['Bar 1 X starting']);
- var bar1y = parseInt(parameters['Bar 1 Y starting']);
- var bar1w = parseInt(parameters['Bar 1 Width']);
- var bar1h = parseInt(parameters['Bar 1 Height']);
- var b1c1 = parseInt(parameters['Bar 1 color 1']);
- var b1c2 = parseInt(parameters['Bar 1 color 2']);
- function Map_Bar1() { this.initialize.apply(this, arguments); }
- Map_Bar1.prototype = Object.create(Window_Base.prototype);
- Map_Bar1.prototype.constructor = Map_Bar1;
- Map_Bar1.prototype.initialize = function(x, y, width, height) {
- Window_Base.prototype.initialize.call(this, x, y, width, height);
- this._helpWindow = null;
- this._handlers = {};
- this._touching = false;
- this.deactivate();
- this.update();
- };
- Map_Bar1.prototype.update = function() {
- Window_Base.prototype.update.call(this);
- this.contents.clear();
- this.drawBar1( bar1x-16, bar1y-16, bar1w);
- };
- Map_Bar1.prototype.drawBar1 = function( x, y, width) {
- this.opacity = 0;
- this.makeFontSmaller();
- var color1 = this.textColor(b1c1);
- var color2 = this.textColor(b1c2);
- this.drawGauge1(0, 0+32, width+32, 100 / 300 , color1, color2);
- this.drawText('var/varMax', 0 , 0, width, 'center');
- };
- Window_Base.prototype.drawGauge1 = function(x, y, width, rate, color1, color2) {
- var fillW = Math.floor(width * rate);
- var gaugeY = bar1h + this.lineHeight() - 8;
- this.contents.fillRect(x, y, width, bar1h, this.gaugeBackColor());
- this.contents.gradientFillRect(x, y, fillW, bar1h, color1, color2);
- };
- var alias_SceneMapOnMapLoaded = Scene_Map.prototype.onMapLoaded;
- Scene_Map.prototype.onMapLoaded = function() {
- alias_SceneMapOnMapLoaded.apply(this, arguments);
- };
- Scene_Map.prototype.createBar1 = function() {
- this.Bar1 = new Map_Bar1(bar1x, bar1y, bar1w+32, bar1h +32);
- this.addChild(this.Bar1);
- };
- var alias_createDisplayObjects= Scene_Map.prototype.createDisplayObjects;
- Scene_Map.prototype.createDisplayObjects = function() {
- alias_createDisplayObjects.call(this);
- this.createBar1();
- };
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement