MogHunter Monogatari - Mog_SceneMenu (Playtime clock)

Parallax Panda

Got into VxAce ~2014 and never stopped...
Veteran
Joined
Oct 29, 2015
Messages
983
Reaction score
1,275
First Language
Swedish
Primarily Uses
RMMV
So I'm using moghunters "Monogatari menu plugins" for my game and it's a bit messy overall but the biggest problem I'm having is with the "Playtime clock" displayed in the Menu's main scene (the first scene that launches when you press "ESC". The plugin file that edits this scene is called: "MOG_SceneMenu".

The problem is that unless I use a Monospaced font (which I don't) the timer that counts up is moved a few pictures left and right depending on the currently displayed numbers width, every second it ticks - and it doesn't look very good.

Is there a way to fix this?

I can't turn off the playtime in the plugin parameters so it has to be in the menu. And well, to be honest, I actually prefer to display the playtime if possible. I'd rather find a fix for the clock then to find a fix to hide it.

Finding a monospace font to replace my current font is the most obvious work around of course but it's really a last resort since I use Google Fonts and there's only like 3-5 really booring monospace fonts on there...

Oh, and if someone tries to replicate the error keep in mind that the font that RM uses by default is a monospace font so you'd not be able to see the playtime clock jump around with that font as gamefont.
 

pasunna

Veteran
Veteran
Joined
Feb 3, 2019
Messages
528
Reaction score
220
First Language
thai
Primarily Uses
RMMV
but... I don't know which font is not mono space...
can you suggest one so I can test...
 

Eliaquim

Raze: The Rakuen Zero's Guardian!
Veteran
Joined
May 22, 2018
Messages
1,339
Reaction score
592
First Language
Portuguese - Br
Primarily Uses
RMMV
Hi there! ^^
Well, I have a similar problem with my timer plugin.
So maybe this will help you:

JavaScript:
Scene_Menu.prototype.createPlayTime = function() {
    this._playTime = new Sprite(new Bitmap(this.getTimerWidth(),32));
    this._playTime.x = Moghunter.scMenu_playTimeNumberX;
    this._playTime.y = Moghunter.scMenu_playTimeNumberY;
    this._playTime.bitmap.fontSize = Moghunter.scMenu_playTimeNumberFontSize;
    this._field.addChild(this._playTime);
    this._playTimeSec = this.playTimeSec();
    this.refreshTime();
};

Scene_Menu.prototype.getTimerWidth = function(){
    const sprite = new Sprite();
    const pad1 = Window_Base.prototype.standardPadding();
    const pad2 = Window_Base.prototype.textPadding()*2;
    sprite.bitmap = new Bitmap(1,1);
    sprite.bitmap.fontSize = Moghunter.scMenu_playTimeNumberFontSize;
    let width = Math.floor((sprite.bitmap.measureTextWidth(" 00:00 ") + pad1 + pad2));
    if(width % 2 !== 0) width += 1;
    return width
};

Scene_Menu.prototype.refreshTime = function() {
    this._playTime.bitmap.clear();
    this._playTimeSec = this.playTimeSec();
    this._playTime.bitmap.drawText($gameSystem.playtimeText(),0,0,this.getTimerWidth (),32,"right");
};
Take this code and replace the one in the Mog menu, in line 396.
See if it helps, I do not test it.

You can also try to change the align property to "center" instead of "right", in this line:
JavaScript:
this._playTime.bitmap.drawText($gameSystem.playtimeText(),0,0,this.getTimerWidth (),32,"right");
 

Parallax Panda

Got into VxAce ~2014 and never stopped...
Veteran
Joined
Oct 29, 2015
Messages
983
Reaction score
1,275
First Language
Swedish
Primarily Uses
RMMV
@pasunna
This is the font I'm using and it's not monospace (most fonts are not monospace).

@Eliaquim
Thank you, but I can't get any of those two solutions to work. Putting "Center" instead of "Right" only changed the placement slightly, the problem remained.

The other solution, for a non-programmer like myself, I had to try out a bit more to see if I was doing it right but I think I did and the result for me was that problem remained plus it introduced a new problem (the timer got cut of and only displayed ~2 numbers which I think must have been the hour count)
 

Eliaquim

Raze: The Rakuen Zero's Guardian!
Veteran
Joined
May 22, 2018
Messages
1,339
Reaction score
592
First Language
Portuguese - Br
Primarily Uses
RMMV
@pasunna
This is the font I'm using and it's not monospace (most fonts are not monospace).

@Eliaquim
Thank you, but I can't get any of those two solutions to work. Putting "Center" instead of "Right" only changed the placement slightly, the problem remained.

The other solution, for a non-programmer like myself, I had to try out a bit more to see if I was doing it right but I think I did and the result for me was that problem remained plus it introduced a new problem (the timer got cut of and only displayed ~2 numbers which I think must have been the hour count)
Ok.. I will see if there is a solution for it later, maybe have to split each number into a single bitmap...
 

Parallax Panda

Got into VxAce ~2014 and never stopped...
Veteran
Joined
Oct 29, 2015
Messages
983
Reaction score
1,275
First Language
Swedish
Primarily Uses
RMMV
@Eliaquim
Thank you for helping out. It's a minor thing but I'm all about polish and this annoys me way more than it should. :D
 

Eliaquim

Raze: The Rakuen Zero's Guardian!
Veteran
Joined
May 22, 2018
Messages
1,339
Reaction score
592
First Language
Portuguese - Br
Primarily Uses
RMMV
@Eliaquim
Thank you for helping out. It's a minor thing but I'm all about polish and this annoys me way more than it should. :D
I will try my best. But just to be sure that I understand your issue correctly, you can send a little video or gif with the issue happening?
 

pasunna

Veteran
Veteran
Joined
Feb 3, 2019
Messages
528
Reaction score
220
First Language
thai
Primarily Uses
RMMV
I see
just try 'left' instead
the number will still flex a little
but as it anchor to the left
it less notice able

you can adjust x y of the time
(text, x, y, maxWidth, lineHeight, align)
by change x y from 0,0
or... I think mog had some setting in plugin parameter
 

Parallax Panda

Got into VxAce ~2014 and never stopped...
Veteran
Joined
Oct 29, 2015
Messages
983
Reaction score
1,275
First Language
Swedish
Primarily Uses
RMMV
Phew, okay guys. @pasunna & @Eliaquim , I finally got back home and made a recording of the issue:

Just so we're all on the same page of what the issue is.

Pasunna
There's no setting on the plugin parameters unfortunately. There's Time X, Y and font size. Which I guess means that if it's not solvable I can rework my menu GUI and just throw the darn clock off-screen but I'd say that's a last resort as I personally think playtime is valuable information to have.

Wait(!)... I just changed the alignment to "left" like you suggested and the jumping around seems to have stopped? I... can't understand why... but it doesn't seem to move anymore?

...uh. Well, this is good, but I wonder what will happen once I pass 99 hours and it breaks into another digit? Will it move? Will the timer be pushed towards the left or right?

Hm, is there a script call or something I can run to add time to the playtime timer somehow for testing purposes?
 

pasunna

Veteran
Veteran
Joined
Feb 3, 2019
Messages
528
Reaction score
220
First Language
thai
Primarily Uses
RMMV
Phew, okay guys. @pasunna & @Eliaquim , I finally got back home and made a recording of the issue:

Just so we're all on the same page of what the issue is.

Pasunna
There's no setting on the plugin parameters unfortunately. There's Time X, Y and font size. Which I guess means that if it's not solvable I can rework my menu GUI and just throw the darn clock off-screen but I'd say that's a last resort as I personally think playtime is valuable information to have.

Wait(!)... I just changed the alignment to "left" like you suggested and the jumping around seems to have stopped? I... can't understand why... but it doesn't seem to move anymore?

...uh. Well, this is good, but I wonder what will happen once I pass 99 hours and it breaks into another digit? Will it move? Will the timer be pushed towards the left or right?

Hm, is there a script call or something I can run to add time to the playtime timer somehow for testing purposes?
it's not
that change your text to anchor to the left
if you use text editor like microsoft word or event on web
if you stick to right paragraph or center
it will auto adjust your paragraph
but if you stick to the left it will auto too
but just length more to the right
so... you are lessly to see it change compare to center and right
 

Parallax Panda

Got into VxAce ~2014 and never stopped...
Veteran
Joined
Oct 29, 2015
Messages
983
Reaction score
1,275
First Language
Swedish
Primarily Uses
RMMV
@Eliaquim & @pasunna
This seems to work well enough that I can call it a solution. Thanks for the help guys!

However I have a followup question. Right now the playtime counter displays double digits for hours, minutes and seconds, like this --->00:00:00

If possible I'd like it to display triple digits four hours only, like this --->000:00:00

Is this a simple edit or fix to the script?
 

pasunna

Veteran
Veteran
Joined
Feb 3, 2019
Messages
528
Reaction score
220
First Language
thai
Primarily Uses
RMMV
well... it use default game time
and I don't know about that...
 

Parallax Panda

Got into VxAce ~2014 and never stopped...
Veteran
Joined
Oct 29, 2015
Messages
983
Reaction score
1,275
First Language
Swedish
Primarily Uses
RMMV
Yeah, I'm not code savvy but I assume by looking at Mog's script it just calls a pre-existing function which is "Game Time" and that function is already set up so it displays 00:00:00.

Maybe if I got a seperate plugin for this it would work?
 

pasunna

Veteran
Veteran
Joined
Feb 3, 2019
Messages
528
Reaction score
220
First Language
thai
Primarily Uses
RMMV
yes
I suggest start a new post about that
I never mess with game time before
actually I interesting only what I would use in my game too haha
and I think default time is fine
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I count on someone one time, I let them promise something to me, and one week later it's complete silence as I'm completely let down. I hate everything.
Everytime I need to write dialogues I find myself writing new music pieces... what kind of trick is this?!
Me Being Dumb spending hrs trying to figure out Irenas Visual Novel busts plugin..lol. I'm probably missing something stupid and obvious xDD

let the journey begin >w>
X.X ok... I guess I'll just have to think about 48x48 a little differently. Its not "room for more work"..."its room for more detail!...yay"
Alexa, play Buck-Tick - Dress

Forum statistics

Threads
99,218
Messages
963,162
Members
130,806
Latest member
Niickpv90
Top