Help Scripting Menus, Window_Base.update, lag & fps loss issues

Joined
Jun 30, 2017
Messages
42
Reaction score
35
First Language
spanish
Primarily Uses
RMMV
Hi, I'am trying to implement my own custom menus and now scripting some windows. After looking at some examples and tutorials what i do is create a Game_Window instance, and play with .update() to refresh my window.

Code:
My_Window.prototype.update = function() {
      Window_Base.prototype.update.call(this);
      this.contents.clear();
      this.drawText('test', 200,200,200);
}
I noticed that this recreates all the conents inside the window, but some tutorials suggests to do that.
Additionally, because i need to put some decorative images, used this funcion to draw images inside the window:

Code:
Window_Base.prototype.drawPicture = function(pictureName, x, y) {
                var bitmap = ImageManager.loadPicture(pictureName);
                var pw = bitmap.width;
                var ph = bitmap.height;
                var sx = 0;
                var sy = 0;
                this.contents.blt(bitmap, sx, sy, pw, ph, x, y);
        };

That works, but after some time with the menu open, the game starts to slow down, soon becomes irresponsive, and FPS
drops to 10.. 5... 1... freezed.

I dont know where exactly is the problem, maybe the drawPicture its not well implemented, or maybe drawing the full window every time its not the whay to go. In case the problem is the last one, how i can update parts of the window without calling contents.clear()+redraw every time?

I dont want to redraw the window only when some key is pressed because there are some decorative moving images on the menu.

Any help will be apreciated.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,047
Members
137,569
Latest member
Shtelsky
Top