Mouse click on images to trigger common event - VX ACE

Hello good day.

i am using the falcao mouse button script to use the mouse in my game.

There are some menus of my game that I show through images and to scroll through the pages you must use the arrow keys (<- ->) and this is somewhat uncomfortable.

Is there any way to execute a common event (to move to other images) by clicking on a corner of the screen? for example in a corner of the image with specific coordinates?

I do all this so that the player can go through the pages by clicking on the coordinates where the arrows that indicate turning the page are. (See next picture)

Sin título.png


Thanks.
What are you using to show the images?
A script or an event?
Basically how do you get to the place where you are showing images?

If it involves a scene like the menu then adjusting the script for that would be the option.
If it's an event, then you will need a parallel process event to check the mouse position and activate the CE when clicking.
What are you using to show the images?
A script or an event?
Basically how do you get to the place where you are showing images?

If it involves a scene like the menu then adjusting the script for that would be the option.
If it's an event, then you will need a parallel process event to check the mouse position and activate the CE when clicking.
hello.

I am using a common event to display the images.

when the player presses the left arrow, it goes back one page (image), when he presses the right key, it goes forward one page (image)
So the common event is always running (parallel process) for that scene?
Then just do a conditional branch check for mouse position.
You can do a script check or the conditional branch check.

Script check

Ruby:
if $mouse_cursor.x <= 30
  if $mouse_cursor.y.between?(200, 240) # again position for size of button
    if Input.trigger?(:C)
      $game_temp.reserve_common_event(3) # common event number
    end
  end
end
if $mouse_cursor.x >= Graphics.width - 30 
  if $mouse_cursor.y.between?(200, 240) # again position for size of button
    if Input.trigger?(:C)
      $game_temp.reserve_common_event(4) # common event number
    end
  end
end
forget it, I already understood how to put the code in conditionals.
thanks, it works great, have a nice day!
here
1647734529032.png

1647734539184.png

if $mouse_cursor.x <= 30 -> why 30?
if $mouse_cursor.y.between?(200, 240) -> why 200 or 240?

i don't understand.

WOW, you don't know about the size of the graphic? or you don't know about screen pixel resolution? The whole time you've been using the mouse script and the addons I gave you, you never looked at the code?

1647734715130.png


You understand that the resolution of the window for VX Ace by default is 544x416
so X goes from the left at 0 and increases as you move right until you reach max X at 544.
And Y goes from the top at 0 and increases as you move down until you reach max Y at 416
XYpos.png


Now I gave you the script check as you can put everything into one spot. The conditional branch process would be quite long and just more clicking.

It's also weird that you blocked out all the names of the scripts.
I don't think anyone would care what scripts you're using unless you got them without paying for them or some other nefarious thing.
here
View attachment 220419
View attachment 220420


WOW, you don't know about the size of the graphic? or you don't know about screen pixel resolution? The whole time you've been using the mouse script and the addons I gave you, you never looked at the code?

View attachment 220421

You understand that the resolution of the window for VX Ace by default is 544x416
so X goes from the left at 0 and increases as you move right until you reach max X at 544.
And Y goes from the top at 0 and increases as you move down until you reach max Y at 416
View attachment 220422

Now I gave you the script check as you can put everything into one spot. The conditional branch process would be quite long and just more clicking.

It's also weird that you blocked out all the names of the scripts.
I don't think anyone would care what scripts you're using unless you got them without paying for them or some other nefarious thing.
I already understood how to put the code in conditionals.
I haven't had a good day, my head is somewhere else haha.

thanks

Original thread: https://forums.rpgmakerweb.com/threads/mouse-click-on-images-to-trigger-common-event-vx-ace.145923/