lordvalinar

Lord of the Damned
Veteran
Joined
Mar 31, 2013
Messages
301
Reaction score
161
First Language
English
Primarily Uses
RMMZ
StatusWindow.png

Question (Short version): How does VS create the rectangle fills in this window?

Question (Long version): I am looking to create some background fills in my own status window, somewhat similar to this layout (The selected item/it's type/# in possession, the stats and how the item changes them, all condensed). How do I go about making the rectangle fills within?

* So I do know about bitmap.fillRect() function, and I also know about the rmmz_windows.js pre-made itemLineRect(index) functions, etc
* What I'm mostly looking for (Especially if the VS team wants to answer this) is which method was used, assuming the window doesn't have any "lines" to draw in, would probably use the custom fillRect() I'd assume. Is there a formula used in spacing them out so evenly, or was it just trial and error?

Note: I did want to add however, that the intention of this question was strictly for the back rectangles for the content. It is not intended to steal/copy VS work nor ask for instructions, "make this for me", or information about the other content within the window (I already know how to draw the icons, names, change colors, centering, etc). Just mainly wondering how to make that nicely formed grid of rectangles..
 
Last edited:

Drakkonis

Veteran
Veteran
Joined
Mar 5, 2021
Messages
209
Reaction score
157
First Language
English
Primarily Uses
RMMZ

Question (Short version): How does VS create the rectangle fills in this window?

Question (Long version): I am looking to create some background fills in my own status window, somewhat similar to this layout (The selected item/it's type/# in possession, the stats and how the item changes them, all condensed). How do I go about making the rectangle fills within?

* So I do know about bitmap.fillRect() function, and I also know about the rmmz_windows.js pre-made itemLineRect(index) functions, etc
* What I'm mostly looking for (Especially if the VS team wants to answer this) is which method was used, assuming the window doesn't have any "lines" to draw in, would probably use the custom fillRect() I'd assume. Is there a formula used in spacing them out so evenly, or was it just trial and error?

Note: I did want to add however, that the intention of this question was strictly for the back rectangles for the content. It is not intended to steal/copy VS work nor ask for instructions, "make this for me", or information about the other content within the window (I already know how to draw the icons, names, change colors, centering, etc). Just mainly wondering how to make that nicely formed grid of rectangles..
If you're talking about the background bitmap, it's pulled from the window's skin bitmap. I'm not sure if it's tiled or stretched. I've not experimented much with it.

From the image above, I'd assume that VS has the image drawing occurring in distinct sections rather than the entire background, as is normal.

The following is stuff I've picked up very recently, and claim no expertise in. I've been dabbling in a project that lead to me having to learn some of this:

Most windows have at minimum, the following sprites: those used to draw the window borders, the background, and the foreground. The background is (window object).contentsBack. Since that(I believe) is a direct reference to the sprite's bitmap, you should be able to do all your drawing functions on that.

As for the layout... I imagine anyone designing a custom window will want it to look the same no matter what size the game window is, and so have the layouts planned out in relation to each other, using the size of the window as bounds and a reference point. They probably also have a minimum size to make sure the contents can be clearly seen.
 

lordvalinar

Lord of the Damned
Veteran
Joined
Mar 31, 2013
Messages
301
Reaction score
161
First Language
English
Primarily Uses
RMMZ
If you're talking about the background bitmap, it's pulled from the window's skin bitmap. I'm not sure if it's tiled or stretched. I've not experimented much with it.

From the image above, I'd assume that VS has the image drawing occurring in distinct sections rather than the entire background, as is normal.

The following is stuff I've picked up very recently, and claim no expertise in. I've been dabbling in a project that lead to me having to learn some of this:

Most windows have at minimum, the following sprites: those used to draw the window borders, the background, and the foreground. The background is (window object).contentsBack. Since that(I believe) is a direct reference to the sprite's bitmap, you should be able to do all your drawing functions on that.

As for the layout... I imagine anyone designing a custom window will want it to look the same no matter what size the game window is, and so have the layouts planned out in relation to each other, using the size of the window as bounds and a reference point. They probably also have a minimum size to make sure the contents can be clearly seen.
I mean you're close. It works on the "this.contents" layer (as that is the bitmap). From the day of experimenting, it's a bunch of fillRects() using a single new Rectangle() method, which has its X, Y, Width, and Height adjusted as necessary and some for-loops in the later portions. I think I've pretty much gotten it.

Although I doubt it, I would still love to hear VS input on this :p But otherwise I think I have my answer now. Going to spice it up a bit and fill it in with contents.
 

Attachments

  • latest.png
    latest.png
    561.4 KB · Views: 4

Drakkonis

Veteran
Veteran
Joined
Mar 5, 2021
Messages
209
Reaction score
157
First Language
English
Primarily Uses
RMMZ
I mean you're close. It works on the "this.contents" layer (as that is the bitmap). From the day of experimenting, it's a bunch of fillRects() using a single new Rectangle() method, which has its X, Y, Width, and Height adjusted as necessary and some for-loops in the later portions. I think I've pretty much gotten it.

Although I doubt it, I would still love to hear VS input on this :p But otherwise I think I have my answer now. Going to spice it up a bit and fill it in with contents.
Ah, wasn't sure if the rectangles were being drawn with the foreground or the background. Either would do, so long as everything IN the rectangles are drawn AFTER them.

I'm not sure how often someone manipulates the background, most aren't interested in it beyond making sure a window skin displays the way they want it to.
 

lordvalinar

Lord of the Damned
Veteran
Joined
Mar 31, 2013
Messages
301
Reaction score
161
First Language
English
Primarily Uses
RMMZ
The console is a very useful tool. I'm there writing up new windows on the fly in there (of course don't forget to add to the scene as a child or it won't show heh..) Although in the screenshot was all done in the actual plugin (funny enough, even the console doesn't want to run some functions properly :p) Who knew xD
 

lordvalinar

Lord of the Damned
Veteran
Joined
Mar 31, 2013
Messages
301
Reaction score
161
First Language
English
Primarily Uses
RMMZ
Getting closer, but for some reason it only loads up the first actor upon first opening the window:
EA.png

Then when highlighting/selecting anything else in the menu (it refreshes - again):
EB.png

After closing the loot screen. I open it again, and all actors appear (as they should've in the first place). This leads me to think that something is going on with the image loading - and saw there was a bug with that. So I am thinking that MIGHT be what is happening?

Which would be a huge relief, otherwise I think I'm going insane lol
 

Drakkonis

Veteran
Veteran
Joined
Mar 5, 2021
Messages
209
Reaction score
157
First Language
English
Primarily Uses
RMMZ
Getting closer, but for some reason it only loads up the first actor upon first opening the window:

Then when highlighting/selecting anything else in the menu (it refreshes - again):

After closing the loot screen. I open it again, and all actors appear (as they should've in the first place). This leads me to think that something is going on with the image loading - and saw there was a bug with that. So I am thinking that MIGHT be what is happening?

Which would be a huge relief, otherwise I think I'm going insane lol
I imagine so. I've had issues with image loading in the past and was told it's a preloading issue. Audio apparently suffers from this as well. I understand it like this:

It takes time for an image to load. But if something tries to use an image right after starting to load it, there's no completed image to work with so you get nothing.
Depending on how you want to use images, the methods apparently vary. One solution is to preload EVERY image you're going to use, and keep it cached. MV and MZ caches every image it loads, which is why the second time the image displays correctly, it's loaded by then and wasn't the first time. But if the images you're going to use aren't predetermined, it's not a very efficient solution.

I'm working on something now that DOES use user-defined images, and it works just fine. I think it's because I redraw the picture on every update, instead of only drawing it once. So when it's still loading, the picture is blank, but the window updates fast enough that by the time the image is loaded you never actually see a blank image. (I'm assuming this is the case. I just know it works and this explanation fits best with how I GOT it to work.)

I actually wonder if attaching a window refresh call to the bitmap's load listener would work? If it does, it might be better for static images. My project could probably try that anyway, cut down on redraw cycles. I've not experimented much with bitmap load listeners beyond when I was trying to get the preloading thing figured out. Since I didn't understand what I was doing my results were... not useful.
 

Latest Threads

Latest Profile Posts

I'm looking for VOICE ACTORS! PAID!

If interested check out my game. It has the Details. 3 days left for the audition, 22 roles available.
me: “I’m gonna take a break from game making.”
*five hours later*
me: yeah okay fine I needed to redo that map. Sure.
The OFFICIAL RPG Maker Discord Server is Here | RPG Maker News #116

And the time has come for me to enjoy a good cup of hot cocoa before I sleep... Strangely, that actually helps.
If I ever need to stay up late working on projects, I always get tired. Do you guys think I should try G-Fuel to keep me up and focused at night? And if so, what flavor is best?
I do tend to be quite a night owl.
"Same as it ever was. Same as it ever was. Same as it... EVER was."

Forum statistics

Threads
113,974
Messages
1,078,747
Members
148,072
Latest member
raffa2k
Top