MV SRD_TimerUpgrade (modded or patch needed)

Hello community,

I hope someone could help me patch or modify the plugin so the timer stays on its place,
without moving to the left and right a tiny bit (see gif). [link: SRD_TimerUpgrade]
Timer.gif


I know Eli_Timer as well, which seems to fix that issue, even if it's a great plugin,
it require 2 other plugins + its missing 1 or 2 features so I cannot use that.

if anyone can help me modify or patch this plugin would be greatfull.
A link to the plugin would probably help whoever will help you.

That said, it looks like a mixture of two effects - the plugin has the text display centered (which is normal for most such signs), and additionally the font used has a variable letter size (see how 1 and 0 require different space? that is making the center-alignment move around).
The display would probably be OK if you used a font with a fixed letter size instead.
@Andar I thought I missed something and added the link.
the font used is something I need to match the game.

only text boxes doesn't have this font in use currently and not intend too.
but even the regular timer has the same issue.

as it could be fixed, to seperate the numbers, it could work, but I'm not
exactly sure how and it uses a "measureTextWidth".

so I dont know how to alter that to make it set still in 1 spot.
If you could somehow left justify that textbox instead of center, it wouldn't be quite as noticeable.
I dont know how, as it is not a text box, and it need to be centered 🙂
I dont know how to make it on place either.

all I know is that those font are centered, but it uses a measureTextWidth
and I dont know why it use that in a sprite_Timer, but if there is a way to
set each number with the same with (each number in a box of 20x20,
it might solve it as well, but the font size is 48 that I use, so I dont know.
There are font editors, such as FontForge - you could try to go through all of the numerals and resize their width box without altering the look of the font.

Or replace references to measureTextWidth with a static number.
@ATT_Turan how exactly do you measureTextWidth with a static number?
as I dont understand SRD coding, so it would be hard to edit the plugin,
as I dont get the sprite_timer in general as well.

I'm still learning JS and trying to understand the functions.

EDIT:
The FontForge didn't work, as I did each on 600px and center it,
the issue persist though.
bumping, in the hope someone could fix it 🙂
It really does look like a font issue.
Have you tried a few different fonts to see if others do the same.
The plugin page shows the numbers working flawlessly.
Can you tell us what that font is? or is it something you made?
@Roninator2 it happens on all fonts though, and like I said in
the first post, Eli_Timer fixed that as you can see it on his thread.

default has also the same issue, as in the plugin has the measureTextWidth,
it is not the font in general, even if I set each number on 500 width,
the issue persist.
I don't understand fully what is happening, but if the text alignment is changed then it makes it less noticeable.
JavaScript:
(function(_, $) {

"use strict";

//-----------------------------------------------------------------------------
// SRD.TimerUpgrade
//-----------------------------------------------------------------------------

Sprite_Timer.prototype.redraw = function() {
    if(this._paused) return;
    const text = this.timerText();
    const width = this.numBitmap.width;
    const height = this.numBitmap.height;
    this.numBitmap.clear();
    this.numBitmap.drawText(text, 0, 0, width, height, 'left');
};

})(SRD.TimerUpgrade, SRD.PluginCommands);
well, that fixed it, 🙂
it stays fixed in the center on top, tiny pushed to teh left,
so I can adjust the icon placed there with hudmaker to make it
fit nicely 🙂

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/srd_timerupgrade-modded-or-patch-needed.145854/