Jump to content

Pixi.js Spine event controlling


Jenson
 Share

Recommended Posts

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
Link to comment
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...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...