RMMV A UI Question (fillRect?)

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,846
Reaction score
1,599
First Language
English
Primarily Uses
RMMV
So I'm trying to adjust the indicator for "Move Points" for this window: (represented by the 4 light gray rectangles)
1606169210453.png
This is currently drawn via this code:
JavaScript:
    //- Move Points
    if (Lecode.S_TBS.Windows.statusWindowShowMovePoints) {
        y -= this.lineHeight() * 2;
        var mp = this._entity.getMovePoints();
        var gw = (160 - mp * 4) / mp;
        x++;
        for (var i = 0; i < mp; i++) {
            this.contents.fillRect(x, y, gw, 4, this.textColor(Lecode.S_TBS.Windows.movePointsColor));
            x += gw + 4;
        }
    }
So my question is: How do I make it so each "rectangle" is a fixed width instead of how the original code does it (uses width of 160 then divides by how many Movement Points, in this case, it's 4). Basically, I want it to look something like this: (it would be even better if they were circles instead lol)
1606169511531.png
Also, it is currently left-justified, and I was hoping it would be possible to make it right-justified. Right now, after you spend a movement point, the right-most rectangle disappears. I would prefer if spending a movement point would make the left-most rectangle disappear 1st.

Edit: Ok, I actually got it to do what I wanted! However, is there a way to use an img instead of fillRect? Or is there a "circle" version of fillRect (or even a square w/ rounded edges)? It would be really sweet if I could just use a "button" looking thing like: 1606171579196.png

So how do I replace those rectangles w/ an img? I already got it to remove move points from the left instead of right:
(4 MovePoints -> 2 MovePoints)
1606171637285.png
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

Finally feel well enough to sketch. Took twenty minutes to find the tablet. Another ten for the cable. Only to discover that my Clip Studio Pro license has expired. Yup. Gonna be one of those days.
Is there a way to add pictures to profile posts?
I just graduated from high school yesterday!
I accidently wipe out my entire hdd...
Hey everyone, I'm going to do winners announcement post for the OCCIII after we get the edit bar fixed. It's kind of hard to do any announcement without formatting! Thanks for the patience.

Forum statistics

Threads
107,651
Messages
1,031,166
Members
139,775
Latest member
SkullMetalLord
Top