[MZ] Phileas' Pointer Picture Trigger (Triggering of the switch, variable, common event by picture)

Plugin name: Phileas' Pointer Picture Trigger

Author: Phileas

Version: 1.8.0 for MZ and 1.0.0 for MV

Release date:
1.0.0 - 2023.December.12
1.8.0 - 2025.August.04

Plugin description:
Triggering of a switch or a variable or a common event when the pointer with the picture acts: enter, exit, press, click.
The plugin provides commands:
  1. Assign - assigns a handler to one type of action with an picture.
  2. Erase action - removes the handler of a single action with an image.
  3. Erase all actions - removes all image handlers.
You can assign your own handler for each type of action, they will work independently.
For example, you can assign two switches to one image: to Enter and to Click.
After deleting an picture, all triggers associated with its number are also deleted.

How it looks like:
2023-12-16_21-38-41.png


Demo project
MV
MZ

Code
MV
MZ

License
This plugin is released under MIT license.
This means that you can freely use the plugin in non-commercial and commercial games and even edit it.
But be sure to include me in the credits!

Compatibility:
Incompatible with the ButtonPicture plugin. However, you definitely won't need it, since my plugin provides all its functionality and even more.
If there are any problems, write to me.
Version 1.1.0!

Now you can assign your own handler to each type of action, they will work independently.
Added commands that allow you to erase one or all picture handlers.
1.2.0

Added features:
  • Assigning to a variable the number of the picture from which the specified action was performed.
  • Assigning an exact value to a variable (as an alternative to the delta of the variable added earlier).
The delta and the exact value can be negative.
1.3.0

Added similar global commands, allowing to set triggers for all pictures.
Great plugin!

Is this there possible to change picture when player hover it?
  • Just an idea,
    1. Trigger event (switch/switch self) by hover.
    2. Possibility to trigger the pixel perfect picture.
      • Only triggering the picture and ingnore the alpha.
  • This plugin will be powerful.
1.4.1
  • Added self switch support.
  • Added alpha pixel check
I also updated the demo project:
Google Drive
Yandex Disk
Is this there possible to change picture when player hover it?
Yes, I added such an example to the demo project.
Just an idea...
I have implemented all this.
Already check the demo!
This is one of the best plugin, thank you!

I'll use it in my next project.
Hello there!
Is it possible when There's 2 picture overlapping.
Then the button only activated the picture with higher id?
I imagine, make ui like a persona game and this is will be easier to make it.

The second one, is possible to add a boolean,
If true: when I hover the button triggering switch and when unhover it, the trigger automatically.

If false: whenever I hover and unhover yhe switch keep stay activated switch.


The otherhand maybe, add sfx when hover and enter the picture. XD
rondchild, hi!

The first point was implemented in the plugin initially.

About the second point...
So far, the logic seems to me too complicated and non-universal to add an option to the plugin command. Can you try to implement this through event logic? You probably know where the switch changes the value. At this point, you need to call the plugin command and change the trigger assigned to the picture.
Hi @Phileas !
Yep, that's already implemented on the plugin.

Some of problem when I use overlap picture, all trigger from picture ID 1 and 2 are triggered.
So, that's why some of idea comes up, when there's overlap picture, only trigger the highest ID picture.
And picture on the below don't need to call any action, except I literally hover/click on picture ID 1 (without any overlap from picture 2).

About the second point...
So far, the logic seems to me too complicated and non-universal to add an option to the plugin command. Can you try to implement this through event logic? You probably know where the switch changes the value. At this point, you need to call the plugin command and change the trigger assigned to the picture.


Yea, basically I already do this. and work well too!!
Thanks
1.4.3
Fixed the calculation of the delta of the variable (there was a typo in the code).
1.4.4
Blocked player movement when the trigger is triggered.
Wow, this is very nice update!
1.5.0
  • Added commands to enable and disable the plugin.
  • The state of the plugin (enabled or not) and global trigger data are now restored when the game is loaded.
Is the demo in gdrive already updated?
Since the folder name doesn't have the version.
1.5.1
Fixed exit trigger.

I also updated the plugin in the demo project demo project.
1.5.2
Fixed checking for transparent pixels if the coordinates of the image were set in the center.
1.6.0
Added the ability to run an arbitrary JS script at the trigger.
MV version

The code is here

The demo is here
1.6.1
Added API.

Original thread: https://forums.rpgmakerweb.com/threads/mz-phileas-pointer-picture-trigger-triggering-of-the-switch-variable-common-event-by-picture.163793/