Toggle Button for HUD

Kuu_t

Veteran
Veteran
Joined
Jun 19, 2016
Messages
33
Reaction score
23
First Language
Finnish
Primarily Uses
RMMV
Hi,

I'm currently trying to do a toggle button for my HUD. To achieve this, I use Yanflys Button Common Events and SmRndDdes HUD maker. Currently, I manage to open the HUD through eventing, but release button doesn't work.

The flow should be like this:
  • - Press E -> Show HUD
  • - Release E -> Hide HUD

I'm working with common events. I simply turn the Toggle HUD switch on when I'm pressing E. Though, I cannot figure out, how I can check when the player releases the key.

Could somebody show me the way with this?


< HUD is on


<HUD is off
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,639
First Language
Czech
Primarily Uses
RMMV
You don't need to check if the button is released. The only thing you need to check is if the button is still pressed.
 

Kuu_t

Veteran
Veteran
Joined
Jun 19, 2016
Messages
33
Reaction score
23
First Language
Finnish
Primarily Uses
RMMV
Thank you for this. Toggle button works fluently, but only with button conditional branches. I've to figure out, what I'm doing wrong when I'm using yanflys Button Common Events plugin.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,639
First Language
Czech
Primarily Uses
RMMV
The rpg_core.js has a tree called "Input". There's a function Input.isPressed(keyName).
So you can do this:
while (Input.isPressed("e") {
your code
}
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,864
Messages
1,017,056
Members
137,573
Latest member
nikisknight
Top