Jump to content

EaselJS: How to block a figure event listener in overlay area


lesnoj
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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.

 

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