Hello !
I've searched into Game_Screen documentation but didn't find anything that could help..
I was wondering if I could get an array of all the on screen events ?
If yes, how should I proceed ? Thank you :)
Get all events visible on the screen
● ARCHIVED · READ-ONLY
-
-
Something like this might be close ...
var screenEvents = $gameMap.events().filter(function(event) { return event.isNearTheScreen(); })
although that might give you events that are just offscreen, but close enough for them to start moving.
If you program, you might be able to use something based on that function:
Code:Game_CharacterBase.prototype.isNearTheScreen = function() { var gw = Graphics.width; var gh = Graphics.height; var tw = $gameMap.tileWidth(); var th = $gameMap.tileHeight(); var px = this.scrolledX() * tw + tw / 2 - gw / 2; var py = this.scrolledY() * th + th / 2 - gh / 2; return px >= -gw && px <= gw && py >= -gh && py <= gh; }; -
Thank you very much, gonna play with that :)