MasterSplinter Posted February 28, 2016 Share Posted February 28, 2016 I couldn't find the mouse controls in the source. Is there a way to set the mouse up event to the html element as opposed to the canvas element? And would it have to be a custom build to do so? Thanks in advance. --Nevermind I see they are all within the cameras. -P Quote Link to comment Share on other sites More sharing options...
MasterSplinter Posted February 28, 2016 Author Share Posted February 28, 2016 I don't know if this is a bug -- Camera controls are attached to the html tag but are on mouse out on the canvas element http://www.babylonjs-playground.com/#EU8RP Quote Link to comment Share on other sites More sharing options...
Wingnut Posted February 29, 2016 Share Posted February 29, 2016 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. Quote Link to comment Share on other sites More sharing options...
MasterSplinter Posted February 29, 2016 Author Share Posted February 29, 2016 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. Wingnut 1 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted February 29, 2016 Share Posted February 29, 2016 i think in browser only you have pointerlock mode for your question Quote Link to comment Share on other sites More sharing options...
MasterSplinter Posted February 29, 2016 Author Share Posted February 29, 2016 Thanks NasimiAsl -- Not exactly what I was looking for but this might be a good enough solution. 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.