Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Window_Alert() {
- this.initialize.apply(this, arguments);
- }
- Window_Alert.prototype = Object.create(Window_Base.prototype);
- Window_Alert.prototype.constructor = Window_Alert;
- Window_Alert.prototype.initialize = function(x, y) {
- var width = Math.floor(Graphics.boxWidth * 0.263);
- var height = Math.floor(Graphics.boxHeight / 3.69);
- Window_Base.prototype.initialize.call(this, x, y, width, height);
- this.refresh();
- };
- Window_Alert.prototype.windowWidth = function() {
- return Math.floor(Graphics.boxWidth * 0.263);
- };
- Window_Alert.prototype.windowHeight = function() {
- return Math.floor(Graphics.boxHeight / 3.69);
- };
- Window_Alert.prototype.refresh = function() {
- this.contents.clear();
- if(!this._windowAlertBmp) {
- this._windowAlertBmp = ImageManager.loadPicture("kevinicon");
- }
- this.contents.blt( this._windowAlertBmp, 0, 0,
- this._windowAlertBmp.width,
- this._windowAlertBmp.height,
- (
- Math.floor(this.windowWidth() / 2) -
- Math.floor(this._windowAlertBmp.width / 2)
- ),
- 0,
- this._windowAlertBmp.width,
- this._windowAlertBmp.height);
- var width = this.windowWidth() - this.standardPadding() * 2;
- var height = this.windowHeight() - this.standardPadding() * 2;
- this.contents.drawText("ALERTS", 0, 0, width, height, "center");
- };
- Scene_Menu.prototype.createAlertWindow = function() {
- this._alertWindow = new Window_Alert(0, 0);
- this._alertWindow.y = Graphics.boxHeight - this._alertWindow.height;
- this.addWindow(this._alertWindow);
- };
- //not sure where you're trying to create the window so I've put it in here...
- var sceneMenuCreate = Scene_Menu.prototype.create;
- Scene_Menu.prototype.create = function() {
- sceneMenuCreate.call(this);
- this.createAlertWindow();
- };
- //forgot about this one
- Scene_Menu.prototype.update = function() {
- Scene_Base.prototype.update.call(this);
- this._alertWindow.refresh();
- };
RAW Paste Data