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._windowAlertSprite) {
- this._windowAlertSprite = new Sprite_Base();
- this._windowAlertSprite.bitmap = ImageManager.loadPicture("kevinicon");
- }
- this._windowAlertSprite.x = (0.5 * this.windowWidth()) - (0.5 * this._windowAlertSprite.width);
- this.addChild(this._windowAlertSprite);
- var width = this.contents.width - this.standardPadding() * 2;
- var height = this.contents.height - 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();
- };
RAW Paste Data