Image display under the button in RPG Maker MZ

Hello, I would like to make something like a map in my game, I would like to do something like that when the player presses the “m” button then an image of my choice will appear (an image of the map that I previously drew in another program) and when the player presses the “m” button again then the image disappears and so that he can do so until I disable such a function for example by switches.

Is it possible to do something like this? And if so how to do it?

Thank you in advance for your help
My Button Event Trigger plugin is your answer

PLK_ButtonToCommonEvent

Hello, I would like to make something like a map in my game, I would like to do something like that when the player presses the “m” button then an image of my choice will appear (an image of the map that I previously drew in another program) and when the player presses the “m” button again then the image disappears and so that he can do so until I disable such a function for example by switches.

Is it possible to do something like this? And if so how to do it?

Thank you in advance for your help
I've attached it to the comment above and tried it again.
My Button Event Trigger plugin is your answer

PLK_ButtonToCommonEvent


I've attached it to the comment above and tried it again.
It works! Thank you so much

My Button Event Trigger plugin is your answer

PLK_ButtonToCommonEvent


I've attached it to the comment above and tried it again.
I have one more question, what to do so that under the same key could be images but on other maps. I tried to do it in several ways but only one image worked each time.
It works! Thank you so much


I have one more question, what to do so that under the same key could be images but on other maps. I tried to do it in several ways but only one image worked each time.
You must specify a different ID for the image to remain.

Code:
if ($gameMap.mapId() === 5) {
console.log("We're on map 5!");
// Do whatever you want when you're on map ID 5
} else {
console.log("Not on map 5");
}
You must specify a different ID for the image to remain.

Code:
if ($gameMap.mapId() === 5) {
console.log("We're on map 5!");
// Do whatever you want when you're on map ID 5
} else {
console.log("Not on map 5");
}
Is it possible to connect multiple common events under the same key? E.g. I have 2 common events (each works depending on the switch) and I want the "m" key to work on them (which one it would work on depends on the switch). I tried to do it this way but it doesn't work. Is it possible to do this somehow?
Is it possible to connect multiple common events under the same key? E.g. I have 2 common events (each works depending on the switch) and I want the "m" key to work on them (which one it would work on depends on the switch). I tried to do it this way but it doesn't work. Is it possible to do this somehow?
You can do this with a variable to give a value from 1-100 equal to the map id and then check the condition that you are currently on which map. Actually, just one is enough.

sx.png

01.png
You can do this with a variable to give a value from 1-100 equal to the map id and then check the condition that you are currently on which map. Actually, just one is enough.

View attachment 323401
View attachment 323400
It works! Thank you

Original thread: https://forums.rpgmakerweb.com/threads/image-display-under-the-button-in-rpg-maker-mz.173329/