Jump to content

Mouse Up Event Released on Exit HTML Element?


MasterSplinter
 Share

Recommended Posts

Hi MS!  I'm not sure why you would attach the camera to non-canvas element, but the document's html element will never give you a mouseout... because your mouse is ALWAYS over a document's html element.  It fills the whole browser window, as far as I know.

Here's a demo that might help.  It is pure DOM events... no cameras involved.  In fact, not much BJS framework involved in the mouse stuff.

http://www.babylonjs-playground.com/#EU8RP#2

I "made" the 'el' element, and appended it into the DIV called 'canvasZone', which is part of the playground's GUI. 

Then, I absolute-positioned 'el' over the canvas... and did some eventHandler fun.  It's easy to see that the mouse-enter and mouse-out events are working fine.

If you use this method in your home project, you will probably need to append 'el' onto the 'body' element, instead.  (not cz or canvasZone)

I'm not very experienced in this area, but maybe something in the demo above, will help.  I hope so.  Keep us posted.

Link to comment
Share on other sites

Hey Wingnut,

I think I might not have made clear what I wanted to do...   But, essentially maintain the mousedown event when leaving the canvasZone or(whatever the canvas id is) and release it only when the mouse is released (inside the body/html tags) or when it leaves the window.  I'll figure this out and post my results unless someone has some insight. :D 

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