Hello guys.
I am using the plugin Aramis Sprite Zoom in my project and it works fine. But it is a bit tedious to put the event ID when I use the command SpriteZoom.zoom(X, Y);
So it occurred to me "automate" that it find the "X" ID of the events after finding all events with the "Z" name, so "X" will be the ID of the event with "Z" name of the event.
I tried to do it but I can't find how and I already know that the code is wrong:
Thanks.
Edit: This code is from this thread.
I am using the plugin Aramis Sprite Zoom in my project and it works fine. But it is a bit tedious to put the event ID when I use the command SpriteZoom.zoom(X, Y);
So it occurred to me "automate" that it find the "X" ID of the events after finding all events with the "Z" name, so "X" will be the ID of the event with "Z" name of the event.
I tried to do it but I can't find how and I already know that the code is wrong:
Code:
Game_Map.prototype.findEventsByName = function (event_name) {
return this._events.filter(ev => {
return (ev) ? ev.event().name == event_name: false;
});
};
Game_Map.prototype.findEventByName = function (event_name) {
return this._events.find(ev => {
return ev.event().name == event_name;
});
};
Code:
SpriteZoom.zoom($gameMap.findEventByName('_char'), 0.2);
Thanks.
Edit: This code is from this thread.