Gui Spine Event (DEF-3056) (SOLVED)

I know I’m on a feature-request spree now but here I go :slight_smile:
We are extensively using events in our spine animations to trigger, well, stuff.
Somehow we cannot use it in GUI. Was this intentionally not implemented or is it broken?

It’s an extremely useful feature.

2 Likes

This was initially discussed during the design, but was left for the MVP implementation. It is certainly something we should support, I see nothing blocking this, but it needs to be prioritised.

Did a quick check in our issues and it seems it wasn’t added after the initial implementation (at least what I could find). So I have added a feature request issue for this: DEF-3056

5 Likes

Released in Defold 1.2.128

Hi, I have 1.2.185 and gui spine event messages still aren’t being received.

It seems to be that if you don’t pass in a callback, the messages aren’t sent properly (we’ll look into that as it’s a regression).
However, the recommended way is to pass in a callback function, and that still works as intended.

As far as I can tell, it’s working as (currently) intended (although I don’t think the current implementation is optimal). Animation done events are sent to the callback (if set), or the on_message. Spine events are (currently) always sent to the on_message function.

Perhaps you can start a new thread with your problem, and perhaps a small repro with your use case?

EDIT: I did however find another regression in the case of receiving spine_event in the callback for spine.play_anim() False alarm, I had some local changes.

1 Like

Ok thanks. I rechecked after reading your message.

  1. If I put a spine model in a Gameobject. Then it will send event messages without calling the animation in code. I can just let the default animation run and it works.
  2. If I put a spine model in a Gui object and let the default animation run. Then it will not send event messages.
  3. If I put a spine model in a Gui object and then call the animation to start in code. Then it starts sending the event messages.
    So my solution is to call gui.play_spine_anim() in my gui script if I want to receive event messages from the spine model. I can’t just create a spine node and let the default animation run and receive event messages like it works with Gameobject spine models.
    Thank you.
2 Likes

Huh, you’ve found another bug there. I’ve added a ticket for this:

1 Like