Morning guys,
So I have created a function in the Sprite class. Just imagine it's something like this:
I need to call this function for the Sprite that draws a particular event, let's say event 214 on the map.
I thought it would be as simple as: $gameMap.event(214).sprite.helloWorld("hi");
But there doesn't seem to be a property "sprite" of event. In fact trawling through the MV scripting reference, I cannot even find a Sprite attached to an Event (or Character, or CharacterBase).
Having created the function I want, how do I call it for a given event's Sprite object?
So I have created a function in the Sprite class. Just imagine it's something like this:
Code:
Sprite.prototype.helloWorld = function(msg) {
console.log(msg);
};
I need to call this function for the Sprite that draws a particular event, let's say event 214 on the map.
I thought it would be as simple as: $gameMap.event(214).sprite.helloWorld("hi");
But there doesn't seem to be a property "sprite" of event. In fact trawling through the MV scripting reference, I cannot even find a Sprite attached to an Event (or Character, or CharacterBase).
Having created the function I want, how do I call it for a given event's Sprite object?