Flickering Images: Caused by Not Preloaded Values?

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,281
Reaction score
106
First Language
Irish
Primarily Uses
N/A
This is a rather a simple, maybe, as a question. So when I was coding a sample menu, I found out that whenever I do use sprites as the command buttons and ran through them, the images flicker not until all of them kinda have been selected. My question is, is there a way to make this coded so all the resources seemingly there already?

First Question:

Are the resources preloaded? Why are my images flickering?

Second Question:

If so, is there a way in js to combat this, so I don't have to worry about flickering images at all? They seem to be in fact, for everything. When I coded a sample window (with the help of Kocka, btw), I found out that whenever I access the Window, the faces don't show quickly. Same goes if I go to the menu.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,637
Reaction score
15,722
First Language
English
Primarily Uses
RMMV
You need to give more info. In fact, we need to see your script.


Resources are preloaded if you tell them to preload. If they are not preloaded, I don't think "flickering" would be the result - I think it would not be there, and then (if you coded in a certain way) it would be there. It wouldn't flicker afterwards.


Faces ARE preloaded when you go to the menu, so that would not be the cause of the flickering.


I'd say it's got something to do with the way you've coded - or maybe another plugin that's causing problems.
 

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,281
Reaction score
106
First Language
Irish
Primarily Uses
N/A
Here's an example:

var commands = ["Item", "Skill", "Equip", "Formation", "Save", "End"];Scene_Menu.prototype.create = function() { Scene_MenuBase.prototype.create.call(this); this.createCommandWindow(); this.createGoldWindow(); this.createStatusWindow(); this.createCommandImages();};Scene_Menu.prototype.createCommandImages = function(){ this._commandSprite = new Sprite(); this.addChild(this._commandSprite);}Scene_Menu.prototype.update = function() { this._commandSprite.bitmap = ImageManager.loadPictures(commands[this._commandWindow._index]); Scene_MenuBase.prototype.update.call(this); } 
Normally, it works...its just that when you move them, the images flicker.
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,606
Reaction score
3,871
First Language
Java's Crypt
Primarily Uses
RMMZ
Yes, you have to preload the images on that case.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,637
Reaction score
15,722
First Language
English
Primarily Uses
RMMV
It still shouldn't make them 'flicker' (flicker is on/off/on/off/on/off) - once they're loaded, they're loaded and should no longer flicker, unless you have something that's clearing the cache on every frame.
 

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,281
Reaction score
106
First Language
Irish
Primarily Uses
N/A
There's none. When you try that it flickers. Say you have 7 commands. It flickers 7 times and after that it goes away.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,637
Reaction score
15,722
First Language
English
Primarily Uses
RMMV
ah, gotcha. Yes, if it's "flickering" once for each, and then no more, it's a preloading issue. If you can track down how it's done for faces, you'll be able to see how to do it for your sprites.
 

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,281
Reaction score
106
First Language
Irish
Primarily Uses
N/A
ah, gotcha. Yes, if it's "flickering" once for each, and then no more, it's a preloading issue. If you can track down how it's done for faces, you'll be able to see how to do it for your sprites.
Hey Shaz, I found out a way when I researched somewhere on Stackoverflow. <3

Though right now manually, you have to preload the specific image for it to work :D
 

ArkDG

Veteran
Veteran
Joined
May 26, 2013
Messages
143
Reaction score
48
First Language
portuguese
Primarily Uses
Sorry for intruding, but... How do I preload an Image?
 

Latest Threads

Latest Posts

Latest Profile Posts

Just tested latest update (Map transfers, Credits scene etc...) on MV (with RETRO) and everything thing seems to work as intended!
credits.png
Ugh, can't decide what to make next!
The Dystopia
ikW0BYF.png
Recently got RPG Maker MZ. A bit slower with my current PC but I will be getting a new one soon.
evening progress; pretty happy where this is at so i'll take the rest of the night to myself =w=
5NJGyKY.png

Forum statistics

Threads
118,403
Messages
1,115,675
Members
155,343
Latest member
sograyish
Top