Hey all,
Currently adding some oomph (or attempting to) to my menus. I like using pictures, so I'm trying to do that. In most cases, it works fine. In some cases, there's a strange thing where the code seems fine, you open a menu, the window is shown and there is no picture. However, if you scroll down and then back up (for example, in Yanfly's Status Menu Core, going from 'Status' to 'Parameters,' and then back to 'Status'), the image appears just fine.
Why doesn't the image appear in the first place? Why does it only appear when the window changes and then changes back?
Here's where I'm inserting my code for YEP_StatusMenuCore.js -- instead of the text for 'Level' appearing I leave the Database input empty (so when the text is drawn, it draws nothing) and then use a picture of a rendered piece of text instead.
After defining my own drawPicture function:
in the snippet for Window_StatusInfo.prototype.drawGeneralParam = function() {}
Right underneath
this.drawText(TextManager.level, dx, rect.y, dw, 'left');
I'll add
this.drawPictureSMC('Textbit_Level', dx, rect.y); (Textbit_Level is the name of the png)
The code clearly works to some extent, just not on the initial appearance of the window.
Anyone know how to fix it, or why it's acting this way? In other windows, this has never been an issue, and the picture loads on every initial appearance of the window.
Well, after googling studiously I found a solution.
https://forums.rpgmakerweb.com/inde...wing-in-the-first-place-in-menu-solved.93711/
However, it does seem to be an inelegant one. Is there a way to reserve an image only when a menu is called, so as not to clog up memory?
Currently adding some oomph (or attempting to) to my menus. I like using pictures, so I'm trying to do that. In most cases, it works fine. In some cases, there's a strange thing where the code seems fine, you open a menu, the window is shown and there is no picture. However, if you scroll down and then back up (for example, in Yanfly's Status Menu Core, going from 'Status' to 'Parameters,' and then back to 'Status'), the image appears just fine.
Why doesn't the image appear in the first place? Why does it only appear when the window changes and then changes back?
Here's where I'm inserting my code for YEP_StatusMenuCore.js -- instead of the text for 'Level' appearing I leave the Database input empty (so when the text is drawn, it draws nothing) and then use a picture of a rendered piece of text instead.
After defining my own drawPicture function:
in the snippet for Window_StatusInfo.prototype.drawGeneralParam = function() {}
Right underneath
this.drawText(TextManager.level, dx, rect.y, dw, 'left');
I'll add
this.drawPictureSMC('Textbit_Level', dx, rect.y); (Textbit_Level is the name of the png)
The code clearly works to some extent, just not on the initial appearance of the window.
Anyone know how to fix it, or why it's acting this way? In other windows, this has never been an issue, and the picture loads on every initial appearance of the window.
Well, after googling studiously I found a solution.
https://forums.rpgmakerweb.com/inde...wing-in-the-first-place-in-menu-solved.93711/
However, it does seem to be an inelegant one. Is there a way to reserve an image only when a menu is called, so as not to clog up memory?