Anomaly

coffee.empty? ? refill_coffee : drink_coffee
Veteran
Joined
Jan 19, 2016
Messages
61
Reaction score
303
First Language
[US] English
Primarily Uses
RMVXA
Hey everyone! Normally, I never really post help topics because I would usually figure everything out myself. Coming from VX Ace
and using MV finally. (I bought back in 2015 as a pre-order). I took it upon myself to finally dive into JavaScript. Having coded a lot in Ruby before (RGSS3's iteration of it) JavaScript has been pretty easy for me to pick up and is actually more efficient in
terms of needing less lines of code. (I love that).

But I feel maybe I'm missing something here, or it's just how MV operates. So here is my issue:

* Created a Window
* Displayed Window on Map Scene
- Open Menu and the Window hasn't disposed??

Okay, regarding that last one... I'm sure I've coded everything else right, but I'm wondering if MV has returned to XP and VX's days where you had to manually dispose windows. I think it's either that, or for some reason Windows must be drawn on the Graphical layer like how sprites were in Ace and every time the Engine takes a "snapshot" for the menu background, it just happens to capture the window as normal "Sprite" and make it part of the background.

Seeing as I'm in the processes of finally willing to fully dive in, feel free to point out my mistakes in my code. Maybe there isn't any issues and it's part of my second theory; but I rather check with people who've been coding for MV all along.

Feel free to take a look at my code here:
Inserting this code into any project will execute just fine. (I've taken the steps to alias what I needed too; so no overwrites!).
Code:
/*:
 * @plugindesc Displays the HUD for the party leader.
 * @author Noct
 * @help This plugin does not have any editable commands.
 */

// DragonHud Window
// Creates the Hud Window for the Party Leader

function Window_DragonHud() {
  this.initialize.apply(this, arguments);
}

Window_DragonHud.prototype = Object.create(Window_Base.prototype);
Window_DragonHud.prototype.constructor = Window_DragonHud;

Window_DragonHud.prototype.initialize = function() {
  Window_Base.prototype.initialize.call(this, 0, 0, 240, this.fittingHeight(4));
  this.refresh();
};

Window_DragonHud.prototype.refresh = function() {
  var leader = $gameParty.members()[0];
  this.contents.clear();
  this.drawActorName(leader, 0, 0);
};

var alias_scene_map_createAllWindows = Scene_Map.prototype.createAllWindows;

Scene_Map.prototype.createAllWindows = function() {
  alias_scene_map_createAllWindows.call(this);
  this.createHudWindow();
};

Scene_Map.prototype.createHudWindow = function() {
  this._hudWindow = new Window_DragonHud();
  this.addWindow(this._hudWindow);
};
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,178
Reaction score
10,797
First Language
Czech
Primarily Uses
RMMV
I don't entirely understand what being disposed of means here. If it's about the snapshot, then yes, you'll need to dispose of windows manually, they will be visible otherwise. Or precisely just set SceneManager._scene._windowLayer.renderable = false (not sure now how is the attribute called exactly, but you should be able to find it).
 

Latest Threads

Latest Posts

Latest Profile Posts

Maybe I should get rid of the Banish ability in my game. It's a non-elemental spell that doesn't even appear in the magic chart. It's only there because my Elementalist doesn't use light or dark magic. It only effects summoned creatures.
ScreenShot_5_18_2022_0_37_0.png
I've been redoing all of the major areas in my game. starting with a place called Century Park. thankfully because all of the locations are distorted memories, I can make these places pretty abstract.
HexMozart88 wrote on RHachicho's profile.
Hey wait a minute, I remember you!

Forum statistics

Threads
121,910
Messages
1,145,094
Members
160,172
Latest member
jadsy
Top