Introduction
͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞
This plugin allows one picture to act as a graphical mask for another.
A mask controls pixel visibility:
- White areas of the mask reveal the picture.
- Black or transparent areas hide the picture.
How to use
͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞
1) Show pictures in an event:
Show Picture #2 → Object Picture (the picture to be masked)
Show Picture #1 → Mask Picture (the picture used as mask)
2) Make sure:
- The Object Picture ID is higher than the Mask Picture ID.
- The mask picture is visually below the object picture.
3) Apply the mask via script call:
$gameScreen.setPictureMask(objectId, maskIds, belowCharacters);
- objectId → ID of the object picture to mask
- maskIds → single number or array of mask IDs
- belowCharacters → set pictures below characters or events (default false)
Example:
$gameScreen.setPictureMask(2, [1,3,5]); //=> to apply multiple masks
Notes:
- Multiple masks can be applied to the same object picture.
- The last mask in the array is applied visually (overwrites previous mask).
To remove mask(s):
1) Remove BOTH object and mask(s):
$gameScreen.removeMask(objectId);
Behavior:
- Detaches all masks from the object picture.
- Erases the object picture.
- Erases mask pictures*only if no other objects are using them**.
Example (Shared Mask):
Object 1 → Mask 5
Object 2 → Mask 5
removeMask(1) →
- Object 1 is removed
- Mask 5 stays because Object 2 still uses it
2) Remove ONLY a specific mask from an object (keep pictures visible):
$gameScreen.removeMaskFromPicture(objectId, maskId, removeObject = false);
Behavior:
- Detaches the specified mask from the object picture.
- Other masks on the same object remain applied.
- Both the object picture and unused masks remain visible.
Example:
Object 1 → Masks [4,5,6]
removeMaskFromPicture(1, 5) →
- Mask 5 is removed
- Object 1 remains masked by 4 and 6
Optional:
removeMaskFromPicture(1, 5, true) →
- Mask 5 is removed
- Object 1 picture is erased along with all its masks.
MZ Plugin Commands
͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞
SetPictureMask
- Object Picture ID: number
- Mask Picture IDs: string (comma-separated list for multiple masks)
Example: Object ID 2, Mask IDs "1,3,5"
RemoveMask
- Object Picture ID: number
MV Plugin Commands
͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞
setPictureMask objectId maskIds
- maskIds can be a single number or a comma-separated string: "1,3,5"
removeMask objectId
Example (MV):
setPictureMask 2 1,3,5 (place picture above characters/events)
setPictureMask 2 1,3,5 true (place picture below characters/events)
Reminder
͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞
• Masks are automatically restored after exiting menus, battles, or map transfers.
• Shared masks are reference-counted:
- A mask is only erased when no objects are using it.
• Multiple masks per object are supported.
• The last mask applied is visually active (on top of previous masks).
• Designed for full compatibility and stability in both MV and MZ.