Jenson

Pixi.js Spine event controlling

Recommended Posts

Hi everyone!

I have some problem with pixi.js spine event.

I am using generated spine json file by another source.

Anyway, it has some user defined events. (Added image file)

image.png.a4ee175a0258a2117a12aa292a42a187.png

I want to customize event end result.

image.thumb.png.52047a87906c4c3506be691ee04dd641.png

How can I do this?

Thanks.

Share this post


Link to post
Share on other sites

If you talk about spine software ? you can remove you event by select your event and click delete icon. (delete key not work in old spine version)
irN5ncfS_o.png

 

If you talk about the api, if you manage one spine events per listener (not recommended in most case) and you want remove. 
you can do

spine.state.removeListener(listener);

Or the best and cleaner way for me is use one listener for all events and just a Switch to call method associate.
And just avoid include your "color" event

Example code.

            const checkEvent = (entry, event) => {
              switch (event.data.name) {
                 case 'eventName0':
                      // call a method when "eventName0":fired!
                    break;
                 case 'eventName1': 
   
                   break;
                case 'eventName44':
                
                break;
                  default:break;
              }
            };
        
            spine.state.addListener({
                event: checkEvent,
            });

 

Edited by jonforum

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.