Something like this?
Usage:
$gameScreen.isPicAt(x, y, pictureId, checkAlpha)
Check if picture #1 is at point (100, 200) - $gameScreen.isPicAt(100, 200, 1)
Check if any picture is at point (100, 200) - $gameScreen.isPicAt(100, 200)
Check with transparency - $gameScreen.isPicAt(100, 200, 1, true/false)
Check array with pictures - $gameScreen.isPicAt(100, 200, [1, 3, 5], true/false)
You can set pictureId to null then it will check any picture too if you need transparency check.
If you're going to use it in a parallel event or in some sort of loop, maybe add like a 10 frame wait just for performance reasons. It probably won't be a problem, but better to be safe.
Spoiler: code
JavaScript:
Sprite_Picture.prototype.isAtPoint = function(x, y, checkAlpha) {
if (!this.visible || !this.bitmap || !this.bitmap.isReady()) return false;
if (!this.getBounds().contains(x, y)) return false;
if (checkAlpha) {
const local = this.worldTransform.applyInverse({x: x, y: y});
const px = Math.floor(local.x);
const py = Math.floor(local.y);
return this.bitmap.getAlphaPixel(px, py) > 0;
}
return true;
};
Game_Screen.prototype.isPicAt = function(x, y, picId = null, checkAlpha = false) {
if (!SceneManager._scene._spriteset) return false;
const picCont = SceneManager._scene._spriteset._pictureContainer;
if (Array.isArray(picId)) {
for (let i = 0; i < picId.length; i++) {
const sprite = picCont.children[picId[i] - 1];
if (sprite && sprite.isAtPoint(x, y, checkAlpha)) {
return true;
}
}
return false;
}
if (picId !== null) {
const sprite = picCont.children[picId - 1];
if (sprite && sprite.isAtPoint(x, y, checkAlpha)) {
return true;
}
return false;
}
for (let i = 0; i < picCont.children.length; i++) {
const sprite = picCont.children[i];
if (sprite && sprite.isAtPoint(x, y, checkAlpha)) {
return true;
}
}
return false;
};