RMMV [SOLVED ] Window_ItemDisplay

Status
Not open for further replies.

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,601
Reaction score
884
First Language
Dutch
Primarily Uses
RMMV
move when in wrong section!

SOLVED: SpacingY between items,

ISSUE LEFT: UPDATE Item Display Picture when opening the scene (see image)
itemscene.png
I hope someone can help me how to update this ItemDisplay window, it does work,
after pressing OK or after pressing Right or Down and back, but not on the 1st item
when opening the scene.

if anyone knows how, I would be happy :)
 
Last edited:

casper667

Casper Gaming
Veteran
Joined
Mar 15, 2012
Messages
202
Reaction score
281
First Language
English
Primarily Uses
RMMZ
Images do not load instantly when you call ImageManager.loadPicture (or other call), so if you try to draw it right away you will run into problems. It appears to work after the initial load because images are cached and don't need to be loaded subsequent times. You need to either add a load listener to the bitmap by doing yourImage.addLoadListener(callbackFunction) which will be called when the image is done loading, or make an update function that checks if the image is loaded every frame.
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,601
Reaction score
884
First Language
Dutch
Primarily Uses
RMMV
I got no idea how to approach that, I got 2-3 refresh function to read th item and item meta,
still learning, there are some other issues with it as well, but I need it anyway otherwise
for improvement for it.

can you make a sample on how to make a call back function?
while refresh and refreshItemDisplay didn't quiet work.
 

casper667

Casper Gaming
Veteran
Joined
Mar 15, 2012
Messages
202
Reaction score
281
First Language
English
Primarily Uses
RMMZ
The code would look something like this
JavaScript:
yourBitmapObject.addLoadListener(this.yourFunctionName.bind(this, {"arg1": arg1, "arg2": arg2}));
Then when the bitmap finishes loading it will call yourFunctionName with the arguments provided (if you don't need any arguments, then you can probably just do:
Code:
bitmap.addLoadListener(this.yourFunctionName.bind(this));
or even
Code:
bitmap.addLoadListener(this.yourFunctionName);
if the "this" context isn't important for your function.

Then in your refresh function (or wherever you start loading the image) you could do something like:
Code:
this.yourVariable = ImageManager.loadPicture(file, hue);
this.yourVariable.addLoadListener(this.yourFunctionName.bind(this));
and then when it's loaded it will call yourFunctionName

---Alternative---

you can also make an update function that checks if ImageManager.isReady() is true, if so draw your image.

Code:
yourClass.prototype.update = function() {
  parent.prototype.update.call(this);
  if(ImageManager.isReady()) {
    this.yourFunctionName();
  }
};
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,601
Reaction score
884
First Language
Dutch
Primarily Uses
RMMV
it has an update function, 3 refreshes to return too, but the code is bit changed, and improved.
as well for the updatePlacements of those images.

so the issue is solved,

while I dont work with loadListener before, the bottom part is something I didn't know either,
but more easier to understand than the others, I keep this is mind and save the samples,
so I can play with those. Thank you for for the time and explanation of those samples.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,622
Reaction score
5,160
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Profile Posts

We are truly intellectuals.
Without using violence without weapons
Our group has as many as 1.3 million people and more than 1 hundred thousand talks.
We gathered in an hour, more than 4.5 Half a hundred thousand



I got a Sword.
I got an Axe.
I got two Swords.
Nothing to see here, just walking with my dog.
I haven’t worked on my game in a while. Tomorrow might be the day.
*squeals* :kaoblush:


I've been experimenting with improved memory management again, which allowed me to include items to increase player path length. These are both 44 grid spaces long, and stable. :LZSexcite:
I FINALLY DID IT! 5 years making my very first game and I just officially released it on STEAM..... OMG..... I can say I finished a game! The feelings!!!!!

Forum statistics

Threads
104,461
Messages
1,006,457
Members
135,969
Latest member
abccc
Top