I found none of this or anything else online helpful. I don't really know how to write javascript but I bumbled my way through enough and found enough pointers on smaller aspects that are used to do this. The BIGGEST resource that helped me achieve this is
Google Doc - RPG Maker MV/MZ Javascript calls
Heres the code I used:
document.addEventListener('mousemove', getMousePosition);
document.addEventListener('mouseenter', getMousePosition);
function getMousePosition(e) {
var x = e.pageX;
var y = e.pageY;
if ($gameSwitches.value(5)) {} else {
if ((x >= 700 && x <=795) && (y >= 306 && y <= 339)) {
$gameScreen.showPicture(1, 'Actor1_1', 0, 256, 95, 100, 100, 255, 0);}
else {
if ((x >= 700 && x <=795) && (y >= 346 && y <= 384)) {
$gameScreen.showPicture(1, 'Actor1_2', 0, 256, 95, 100, 100, 255, 0);}
else {
if ((x >= 700 && x <=795) && (y >= 391 && y <= 424)) {
$gameScreen.showPicture(1, 'Actor1_3', 0, 256, 95, 100, 100, 255, 0);}
else{$gameScreen.erasePicture(1)}}}}}
(My code is set up for a 3 choice option set to the right side of screen. you can change for more choices or different screen position by changing x y coordinates and adding additional if else statements.)
Basically,
1) tell the game to start listening to mouse coordinates
3) set an if else statement to see if in game switch #5 is on or off. (if on do nothing, if off continue on to the next set of if statements)
4) set if else statements to check if the mouse x and y coordinates are within a certain range (have the x-y ranges match where the choices are displaying)
3) set the pictures you want, where you want them.
The switch check I have found necessary. if I dont have it check for that switch then as soon as this script runs, no matter what map you are on, even if the event that ran this script is erased, hovering in the spot where the choices are will display the pictures.
It is worth noting that this only displays pictures on MOUSE HOVER, so choosing options with arrow keys wont show the pictures. I doubt this will help you being 2 years later, but hopefully it helps someone else, because I spent most of a day focused on both building this and trying to get the pictures to not show when the choices are gone.
if you need to find out the mouse coordinates for your choices, make an event that first has the below code, then displays the number of choices where you want them, then has a text box output to show your coordinates.
document.addEventListener('mousemove', getMousePosition);
document.addEventListener('mouseenter', getMousePosition);
function getMousePosition(e) {
var x = e.pageX;
var y = e.pageY;
$gameVariables.setValue(1, x)
$gameVariables.setValue(2, y)
}
Make the text box output something like
"Your X coordinate = \V[1]
Your Y coordinate = \V[2]"