MV Draw Order for Galv's Variable Bar

Hi Makers!

I have just started using Galv's Variable Bar plugin and hit a bit of an issue.
Plugin LINK

I have a bar and a frame set, however, I'd like the bar sprite to be drawn first with the frame image over it to give it a cleaner look.
I'm not exactly sure how I'd go about doing this.
Currently, the "moving" bar is drawn on top of the frame.

I tried changing the order that the images were added in the plugin, but that didn't seem to affect it.

Any assistance would be appreciated!
Thx
When you say you tried changing the order, what did you actually try doing?
When you say you tried changing the order, what did you actually try doing?
I moved the line:
JavaScript:
this.bitmap = ImageManager.loadPicture(obj.barimage2);
down under the line:
JavaScript:
this._bar.bitmap = ImageManager.loadPicture(obj.barimage);
in the plugin as a test.
make sure the bar/filler has the same size, if you have it open the same size,
you can easily control the layer with the variable alone in the editor without
issue 🙂
@ShadowDragon
The issue I have is that the frame I use has small points in the center of each side that the bar would draw over making it look bad.
See the pic attachment in the first OP. It's just a testing image for now, so I'll be able to adjust the dimesions/size, but I need to know how I can make it work as I would not likely be able to easily draw a bar like the ones Galv provided in the plugin demo.
So, I technically would like the barrier/frame to draw over the counter bar.

I just don't see where the actual draw functions are in the plugin.
If I could find that then hopefully, I could see if it's a sprite vs picture thing or whatever.

I'm hoping I'm explaining myself well.
🙂

EDIT: I also tried removing the bar frame from the plugin itself and then adding it via the Show Picture event command and hit the same issue.
if you want to fixt that, its quite easy 🙂 as I have similar on my side game.

you have the frames, inside width/height.

set over frame, cut out and save the filler (and it looks like its behind it 😀)

altering the code is an option too, but image that suits together is an easy fix
if you want the gauge to be rectangle.

another way is to rename the filler as frame and frame as filler I think?
so it works vice versa.

either way works though, but I also modify it more to let is able to rotate =)

its weird while it does say:
barimage = Image name from /img/pictures/ to use for the variable bar
barimage2 = Image name from /img/pictures/ to use for the bar underlay

so not sure why its underlay if its not really below it.
Cutting up the bar to fit seems like the only solution, tho it feels like a cop out...
If you switch the two files, it will fix the drawing issue, but then the frame will be what is drawn.

I'll look into editing the fill bar, tho I am terrible at this kind of thing.
(It took me two hours to figure out how to add transparency to the frame...)

Another potential option will be to change the picture shown to make more of an animated change.
The plugin should be able to do it so long as there's no delay in the drawing of the pictures.

As stated, I'd prefer if the sprite was just drawn under the frame.

I did a bit more digging and this seems to be a regular issue with a few users.
I test around then, but play with it as it seems to be working on my end,
but another work around is a bit more ugly which could work too,
which is drawing 3 images in this aspect.

variable frame draw the frame and empty filler bar.
variable filler draws empty frame and show filler bar.

but I see if I can mess with the code to do the other way around and
actually place the filler bar below the frame.

see what I can do, as modifications to it shouldn't be to hard as I learn from it 🙂
I appreciate the help.

I'll work on things in my end as well.
Thx

EDIT: I figured it out!
What you need to do is make TWO entries for the bars naming the sprite layers ONLY.
From there you can pick the order.

Thanks for the help.

I'm off to continue testing this thing!
🙂
I mess with many I could think off, altering, swapping, etc, but somehow,
it set the filler (barimage) on top and barimage2 always below it.

in order to swap it (I create an "empty" size for both of it) and just
make 2 scriptcalls which set bar1_bg on top, not clean, but it does work otherwise.
workaround.png


a way I kind of told before, but a cleaner approach for this is desired though,
but I have no idea how to get barimage (first call) to set below the barimage2.

another way is make filler the same as frame = 1 pixel, and overlap.
so it also give a illusion that its empty it, but no idea how to set behind it.

either way should work, more annoyed if the color can be changed and shape,
specially by the player to fill it out (which require somehow to swap the 2.

I had fun experimenting on it, but I'm kind of clueless at this point.
@ShadowDragon
I got it figured out.

The way I had to do it was make two entires as before, but make BOTH of them Sprites.

So I did this:
JavaScript:
Galv.VBAR.create(1,"barframe","",x,x,700,725,0,0);
Galv.VBAR.create(0,"barmoving","",y,x,700,725,0,0);

Note that the variables for the first one's fill was the same.
This keeps the image full at all times.

Then the second one was made like normal.
(The file for the still image is blank for them both.)

This works just fine for me.

Thanks again for your help as I pondered how to fix this.
the way I have for screenshot works too if you like to test, but unsure
how the code works.

personally, I wonder why it wasn't written like "frame", "filler"
and the filler lowers which is the top layer (barimage) and backgroud (barimage2).
it should be vice versa, so it works smoother in my opinion, but work arounds
can do its job temporary or fixed as long as it works.
I did try it that way yesterday.

Either way, as long as it's working as intended, I'm happy.
🙂

Original thread: https://forums.rpgmakerweb.com/threads/draw-order-for-galvs-variable-bar.176314/