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
824
Reaction score
323
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,650
Reaction score
8,079
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

Please do not buy games from g2a.com. The sellers have total power over you. The website has many scam sellers. It looks cheap, but the key code didn't work.
A while back I was having fun making my own custom tiles, then I hit carpet... why is it so difficult!? Lol.
Weekend is finally here... what would you like to see (?):
1) Pokemon into zelda minish-cap style
or
2) Pokemon into zelda gbc style
or
3) Zelda into pokemon style

#= Choose ===============#
||__[ Full mockup ]_[ Charset ]__||
#=======================#
I know someday I'll start working on this...

I'm so happy that I got Steam achievements to work in my game, thanks in large part to the posts by other RPG Maker devs on this issue!

Forum statistics

Threads
97,943
Messages
948,060
Members
129,193
Latest member
annygma
Top