lesnoj Posted January 16, 2017 Share Posted January 16, 2017 I have the blue circle and the red over. I want that the blue circle did not react to the events in overlay area. Not correctly working example http://plnkr.co/edit/rRi4w4kRg3VPzhgbitVK?p=preview Quote Link to comment Share on other sites More sharing options...
Anders Athletic Design Posted January 16, 2017 Share Posted January 16, 2017 Yes, it's irritating and it did not work like that in Flash if I remember correctly. As far as I know, you'll have to check if the target is the top-most object with container.getObjectUnderPoint() http://www.createjs.com/docs/easeljs/classes/Container.html#method_getObjectUnderPoint Quote Link to comment Share on other sites More sharing options...
lesnoj Posted January 17, 2017 Author Share Posted January 17, 2017 I want to do so at the time of the running animation (such as moving the character), became inaccessible listeners objects in the scene. To do this, I tried to use the overlay. This is my first acquaintance with CreateJS and I do not know much. Maybe for this, there is another way? UPD: I found an enableDOMEvents method of Stage Class. It is proper to use it? Quote Link to comment Share on other sites More sharing options...
Anders Athletic Design Posted January 17, 2017 Share Posted January 17, 2017 9 hours ago, lesnoj said: I want to do so at the time of the running animation (such as moving the character), became inaccessible listeners objects in the scene. To do this, I tried to use the overlay. This is my first acquaintance with CreateJS and I do not know much. Maybe for this, there is another way? UPD: I found an enableDOMEvents method of Stage Class. It is proper to use it? You can set blue.mouseEnabled to false and you can, of course, also simply remove the listener temporarily. Hiding with overlapping graphics won't work unless you check for top-most object blue.addEventListener('mouseover', function(e) { if(e.currentTarget === stage.getObjectUnderPoint(e.stageX, e.stageY)){ alert('blue hover') } }, false); It's not perfect, however, as mouseover will not be triggered when the mouse moves from overlapped area to visible area. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.