Using drawPicture - it works, but not at first. I have to navigate to another screen and then back.

jeuxdeproust

Warper
Member
Joined
Jul 18, 2017
Messages
2
Reaction score
1
First Language
English
Primarily Uses
RMMV
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?
 
Last edited by a moderator:

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
14,897
Reaction score
8,250
First Language
English
Primarily Uses
RMMV
@jeuxdeproust I merged your posts as we ask members to go back and edit a post, rather than posting again so soon.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Husband has roped me into playing one of his PSO2 characters. Productivity is now negative.
Tileset A is lava! Don't burn D:
as MZ come out what you guys think about.....Some particles engine :3c?
Who wants to sing this song with me?~

Decided to submit my games to the Monday Night Stream. Figured it might be a fun way to get some traction.

Forum statistics

Threads
100,704
Messages
978,549
Members
132,320
Latest member
LavaWave
Top