So I'm trying to adjust the indicator for "Move Points" for this window: (represented by the 4 light gray rectangles)
This is currently drawn via this code:
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)
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:
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)
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;
}
}
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:
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)