Hiding the timer?

Status
Not open for further replies.

Woland

Veteran
Veteran
Joined
Mar 26, 2017
Messages
308
Reaction score
55
First Language
Polish
Primarily Uses
RMMV
I'd like to hide the timer in the upper right corner, but only for a particular event, not all events. Any clever way to do it?
 

ImaginaryVillain

Now A YouTube Cool Kid! =D
Veteran
Joined
Jun 22, 2019
Messages
421
Reaction score
1,526
First Language
Absurdism
Primarily Uses
RMMV
Create a loop, then have it tick down a variable and apply a wait time. Then when the variable hits zero, break the loop and have it do whatever "Timer" event you wanted.
 

Woland

Veteran
Veteran
Joined
Mar 26, 2017
Messages
308
Reaction score
55
First Language
Polish
Primarily Uses
RMMV
Hmm yeah, that's one way to do it, but it's also a parallel process that you can't have too many of and the ticks are going to be performance-dependent, so it's not ideal.
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
820
Reaction score
320
First Language
Javascript
Primarily Uses
RMMV
I'd like to hide the timer in the upper right corner, but only for a particular event, not all events. Any clever way to do it?
Setting the opacity of the timer sprite to 0 works for me :)
Code:
SceneManager._scene._spriteset._timerSprite.opacity=0
...turn it back on with:
Code:
SceneManager._scene._spriteset._timerSprite.opacity=255
Bonus Info:
Code:
SceneManager._scene._spriteset._timerSprite.opacity=0;
var _gt_onExpire = Game_Timer.prototype.onExpire;Game_Timer.prototype.onExpire = function() {
_gt_onExpire.apply(this, arguments);
$gameSwitches.setValue(1, true);
SceneManager._scene._spriteset._timerSprite.opacity=255;
this.stop();
};
Code:
SceneManager._scene._spriteset._timerSprite.opacity=0;var _gt_onExpire = Game_Timer.prototype.onExpire;Game_Timer.prototype.onExpire=function(){_gt_onExpire.apply(this, arguments);$gameSwitches.setValue(1, true);SceneManager._scene._spriteset._timerSprite.opacity=255;this.stop();};

What that does...

...Set the timer sprite opacity to 0
...Alias the function "onExpire" of the Game_Timer Object
...Do what it usually does then add code (optionally just overwrite completely)...
Demo added code:​
  • Sets switch #1 to true
  • Sets opacity to 255
  • Stop the timer (so it doesn't show "00:00")
1585604216542.png
 
Last edited:

Woland

Veteran
Veteran
Joined
Mar 26, 2017
Messages
308
Reaction score
55
First Language
Polish
Primarily Uses
RMMV
perfect, thank you!
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
14,646
Reaction score
8,077
First Language
English
Primarily Uses
RMMV

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.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

I forget what is bumping rule in this forum. Is anyone know? Thank you.
BCj
Ew, why does my blogpost on the rpgmaker.net site look like a garbled mess? Are html codes disabled or something?
I feel that I should cut down on my order queue so I can get some more time for my projects, its been quite a longggg while since I worked on them LOL
I friend of mine insisted on practicing dubbing things with him... and its quite funny, yet, it really takes a huge amount of practice!
Gotta save this for my next thread later...

Forum statistics

Threads
97,881
Messages
947,612
Members
129,116
Latest member
Lupom
Top