[RPGMZ]Event, mouse over the image

Chibi89

Villager
Member
Joined
Sep 5, 2020
Messages
6
Reaction score
1
First Language
italiano
Primarily Uses
RMMZ
Hi guys, I would like to know if without plug-in it is possible to make sure that when the mouse over an image passes it behaves as I want.

Waiting for your eventual response, I wish you a good day.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,224
Reaction score
1,631
First Language
EN
Primarily Uses
RMMZ
Without a plugin, I'd suggest a Parallel event checking cursor coordinates every (few) frame(s), maybe something like this:
Code:
◆If:Script:const picId = 5; SceneManager._scene._spriteset._pictureContainer.children[picId - 1]?.isBeingTouched()
  ◆Text:None, None, Window, Bottom
  :    :Pic 1 hovered!
  ◆
:End
◆Comment:Check once every 6 frames (10 times per second)
◆Wait:6 frames
Easy-copy version of the script I've used here for Conditional Branch > Script:
JavaScript:
const picId = 5; SceneManager._scene._spriteset._pictureContainer.children[picId - 1]?.isBeingTouched()
Replace the 5 with the ID of the picture you want to check.

A plugin would be more efficient, though. I happen to have one that lets you bind common events to "enter"/"leave" cursor actions, as well as offering optional opacity-based hit detection. Here's a link in case you're interested: view/download Cae_PictureTouch.js (Google Drive).
 

Latest Threads

Latest Posts

Latest Profile Posts

Is this Profile Banner thing new? Or did I just discovered it now?
Well.. I was going to post my randomly generated road experiments... But the new "Attach Files" on profile posts seems to be quite buggy. Also there's no more option to insert Imgur images. Highly unfortunate. Guess I'll give them a bit to fix it and go back to messing with stuff.
my first day back to working on my project and i'm pooped!! hope to get back in the rhythm soon!
I just came up with a very original RPG Idea. This is so well written that it might be the first RPG I actually finish making. (I’ve stopped all my projects halfway through development. I don’t think this one will be the same.)

Forum statistics

Threads
107,591
Messages
1,030,800
Members
139,698
Latest member
Tablo_Noir
Top