Forum

Draging outside the canvas

21 February 2017 09:54
E21
Hello,

In the case when the canvas doesn't occupy the entier page, when you click inside the canvas and drag inside the canvas, you can interact with the 3D objects. However, as soon as the mouse is outside the canvas, the interaction stops. I think this is no very good for UX.

Is it possible to continue the interaction when the mouse is outside of the canvas? How can I do it?

BTW, B4W is really a nice piece of software, made with care. Congrats! You guys rock!
21 February 2017 11:28
Api doc.
You need to set the last argument in true.
21 February 2017 16:00
E21
Thank you, but somehow it's not making it for me. I'm probably making something wrong.

In the function load_cb(data_id) {} I added the whole function as: (after "// place your code here")

function load_cb(data_id) {
m_app.enable_camera_controls({
disable_default_pivot: false,
disable_letter_controls: false,
disable_zoom: false,
element: "main_canvas_container", // div container id
allow_element_exit: true
});
}

I also added m_app.enable_camera_controls({ allow_element_exit : true }) below the var m_app = require("app"); but at best I can't keep rotating the object once outside the canvas, at worst, it disables all interaction.

I would really appreciate a helpful hand.
22 February 2017 13:43
Hello

Try the following code lines please

function load_cb(data_id) {
m_app.enable_camera_controls(false, false, false, null, true);
}
22 February 2017 14:09
E21
Thank you, Roman. It works fine. I thought I did that too but obviously I made a mistake.
 
Please register or log in to leave a reply.