Basic RGSS Window Questions

Started by Jaiden, October 23, 2017, 12:09:45 pm

Previous topic - Next topic

Jaiden

Hi guys,

I am pretty new to this forum, but I've been using RPG Maker for a while. I am currently working with RPG Maker XP ("Ace" version). Hopefully I am asking this in the right spot.

I am working on modifying the menu system in my game and I was wondering if there was a good resource that had basic explanations of the basic methods or if someone could give a quick explanation. I don't really need a full RGSS guide--I've got a pretty good handle on things--but I'm curious on the process of drawing a window to make sure I get things right.

I understand the classes "Window_" handle how a window is drawn and "Scene_" actually draws the windows.

I just need a little help with the basic methods and when to use them. I understand "initialize" initializes the object, but I am a little confused with "refresh" and "update" and the difference between the two.

I suppose the TL:DR of my question: Is there a quick explanation on the "refresh" and "update" methods and when to use them when drawing menu windows?

Or, if anyone knows of a nice tutorial focused on creating/editing menu systems specifically, that would also be helpful. I have had a hard time finding one.

Thanks!

Blizzard

October 23, 2017, 01:28:40 pm #1 Last Edit: October 23, 2017, 01:30:47 pm by Blizzard
- update() is called every frame (in theory) in order to process input and stuff that you need every frame
- refresh() can be considered update-on-demand and it also handled drawing on the Bitmaps within windows (since drawing is expensive)

To get more technically, the main() method within a scene is the main loop, it calls its own update() method in a loop then (and does rendering through "Graphics.update"). Within its update() method it usually calls the windows' update() methods. If there are more windows, sometimes some of them aren't visible at the time so it doesn't update them during that time. refresh() is usually only called when some display data needs to be changed in the window, e.g. the HP display changes so the Bitmap object contained within the window needs to be changed.

I can't think of a tutorial right now, but a good idea is that you just go ahead and try to edit the existing menu code (make a backup first!) and just see what happens. The menu code isn't that complicated and now that you know the basics, it should be relatively straightforward to understand what's going on.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.