Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

v3 - Where have buttonMode and interactive gone?


nick-brown
 Share

Recommended Posts

Gents

 

Just upgraded today to 3.0.7 from 2.5.5.  I have 2 categories of sprites (in different but essentially identical containers) with both of the above properties set to true and various events bound to them.  I notice now, that whilst one bunch of sprites correctly has the cursor changing to a pointer, the other set only has it happen to certain of the sprites in the container (the remainder have the default cursor).  Weirdly there now also seem to be ghost areas which do trigger the cursor change despite there being nothing under them.  All bound events still trigger.

 

Attempting to debug I was unable to locate the above properties on the sprites and I notice that the docs now make no mention of them, with a search returning a blank.  So could someone please advise as to the recommended means to achieve this now please.  

 

BTW before anyone mentions the Interaction Manager, the Pixi devs have always maintained that Pixi is solely a graphics engine.  As such I've built my own with vanilla js and Hammer which I'm very happy with and don't wish to swap out.

 

Ta.

 

N

Link to comment
Share on other sites

https://github.com/pixijs/pixi.js/blob/07e4e26f8fd404524a7ebaa73c210de3d8f2cf25/src/interaction/interactiveTarget.js#L23

 

buttonMode is a propert of an interactive target. Which is mixed into the DO prototype if you have the interaction plugin bundled with your pixi build (it does by default):

 

https://github.com/pixijs/pixi.js/blob/07e4e26f8fd404524a7ebaa73c210de3d8f2cf25/src/interaction/InteractionManager.js#L5-L8

 

Same is true with the interactive property.

 

Weirdly there now also seem to be ghost areas which do trigger the cursor change despite there being nothing under them.

 

Not sure about this since all the features you mention are part of the interaction manager, but you mention later that you don't use it...so I'm extremely confused...

Link to comment
Share on other sites

Many thanks for the info.

 

So if I'm reading this correctly, the recommended method currently to enable the cursor to change on hover is via the Interaction Manager? No IM, no go?

 

I'm really struggling to think of a time efficient means to get an illustrative and definitive gist to yourselves (a screenshot is not going to cut the mustard).  Given that I also encountered another bug with the loading of base textures (it just won't work with one particular sprite - used to be fine and there's nothing different about the sprite or the texture) my proposed solution at this stage is to simply revert to 2.2.9.

Link to comment
Share on other sites

So if I'm reading this correctly, the recommended method currently to enable the cursor to change on hover is via the Interaction Manager? No IM, no go?

 

I'm still confused. What I am telling you is that in v3 the IM is the object that changes the cursor. If your cursor is changing at all, and you didn't do it manually, then it was the IM doing it for you. There is no other code in pixi that changes cursor styles besides the interaction manager. Are you using a custom build? Did you manually disable the interaction manager? If not, then you are using the IM right now and just don't realize it.

 

If you want to build your own IM there is nothing wrong with that at all, but I am confused if you are asking about why your custom implementation is broken or why pixi setting the cursor is broken. Because pixi sets the cursor with the InteractionManager, which you say that you don't use. I don't understand how that is possible.

Link to comment
Share on other sites

  • 2 weeks later...

That isn't true though, you just have to make your interaction manager implement them. Those features were in the IM in v2 as well, so I don't understand what the difference is.

I notice now, that whilst one bunch of sprites correctly has the cursor changing to a pointer, the other set only has it happen to certain of the sprites in the container (the remainder have the default cursor). Weirdly there now also seem to be ghost areas which do trigger the cursor change despite there being nothing under them. All bound events still trigger.

I assume you mean this is happening in your app right now, I also assume that you haven't disabled the interaction manager manually so it is running and doing these things for you. If you turn it off, and your custom IM doesn't implement the cursor swapping obviously it won't work.

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...