31
Technical forum / Re: Cant reach inventory's sprite object:(
« on: June 12, 2010, 07:42:48 PM »does the inventory have a owning object?
i ask because my inventory is an animated sprite. now i want to trigger an event and i don't know where i have to catch it
i tried in the game- , scene- and inventory script -
and by the way: when i add a script to the inventory box in the inventory.def file, it doesn't save. perhaps its not meant to add script here?
Hi,
if you added script in WindowEdit to your inventory you should click File->Save. It works fine for me
if you want to trigger some event to any frame in your inventory animation you have to add script for your sprite representing inventory panel. There is event array in SpriteEdit there.
Event - individual animation frames can trigger a script event in their owning object; it's useful when you need to synchronize certain script action with an animation (for example playing footstep sounds)
For example your sprite object contains from 20 frame. If 12 frame is currently playing and you want to add some event write your event name to event array. Now write to your script attached to sprite object this code:
on "MyEvent"
{
DoSomething();
}