RPGMakerMV : The Depth Of The Window Class

Introduction

The Window’s in RMMV are rather interesting. Today we go into the depth of the Window class. First, let’s discuss what the window class truly is.

Windows As Sprites

Sprites are containers as we mentioned in a previous post. Since the sprites are containers for bitmaps, the concept works well for Windows. Why? Let’s go a bit deeper and talk about the specifics of the backbone of RMMV:  Pixi.js.

Pixi.js Sprite Specifics

Pixi.js sprites are the backbone of many of the sprites displayed in RMMV. Now, Pixi.js sprites have some peculiar effects which affect RMMV windows too. Pixi.js sprites can’t have bitmaps as children; a sprite can only have another sprite or containers as a child. This is incredibly important; this means you have to compose multiple bitmaps as sprites. Another important specific is that the order in which you add sprites matters; the last sprite added is always on top of the previous ones. Lastly, Pixi.js sprites use textures (equivalent to bitmaps) as the picture contained within the sprite. Keep all of this in mind, because this is what the Window class is; a complex version of a Pixi.js sprite. Now, before we mentioned textures — aka bitmaps, this is another important factor of the Window class.

The Window Content Area

In RMMV, you can show windows with text, icons, perhaps pictures. How does that work? The reason is the window content area. Now, the window content area is a bitmap within the Window class for drawing content inside the created window.

That means you can use any of the bitmap functions on the content area. Things such as drawing text, rectangles, filling it with color, etc. Take a closer look at Window_Base and the Bitmap class in your RMMV help file for more information on those functions. To draw anything within the window or to make new functionality, understand these concepts are key.

So, what can you do with this knowledge?

What Can You do With Windows?

You can add a window as a child of another window or sprite. This means you can control them like any other sprite and position them relative to their parent sprite! Also, because they’re the sprite’s children, you can control visibility with the parent. Furthermore, the other windows will move with the parent.

You can also add new drawing functions for the content area; you could draw lines, squares, etc. You could also go deeper and use the PIXI.js functions within RPGMakerMV on your windows. Use that to your advantage with the windows you create.

Now, you know the basis of the Window classes in RMMV; they’re just sprites. Use that concept to push your plugin creation and design further!

Leave a Reply

Your email address will not be published.