Forum

How to change cursor into "pointer" or "move" style?

07 December 2015 17:25 #5687
Is it possible to show the "pointer" or "move" cursor when user is over a specific 3d object in js?

07 December 2015 17:29 #5688
I also try to create invisible button with transparent selectable 3d plane object, but it seems not working when the object is fully transparent? Any way to do this?

It's a lot's of questions, but i just begin my journey in Blend4Web!
07 December 2015 17:50 #5689
Hi.

1)
Ответ на сообщение пользователя superbirds
Is it possible to show the "pointer" or "move" cursor when user is over a specific 3d object in js?
You can use pick_object function to detect object and set up cursor style.

2)
Ответ на сообщение пользователя superbirds
I also try to create invisible button with transparent selectable 3d plane object, but it seems not working when the object is fully transparent? Any way to do this?

You can set up Rendering Properties > Do Not Render and Selection and Outlining > Selectable
Blend4Web Team
kirill@blend4web.com
07 December 2015 18:01 #5690
Thank you Kirill.
It 's very helpfull to have such quick response.

For changing the cursor is there a way?
07 December 2015 18:06 #5692

Ответ на сообщение пользователя superbirds
Thank you Kirill.
It 's very helpfull to have such quick response.

For changing the cursor is there a way?

Heh, sorry, my fault. See the answer above.
Blend4Web Team
kirill@blend4web.com
09 December 2015 16:44 #5761
Thank you Kirill,


for the moment i target my b4w container when i detect my object and it works :

var x = m_mouse.get_coords_x(e);
var y = m_mouse.get_coords_y(e);
_my_xy[0] = x;
_my_xy[1] = y;
var obj = m_scenes.pick_object(x, y);
if(m_scenes.get_object_name(obj) === "my_object"){
document.getElementById("main_canvas_container").style.cursor = "pointer";
}


Is it a better way to style directly a 3D object?


09 December 2015 19:08 #5770
Ответ на сообщение пользователя superbirds
Is it a better way to style directly a 3D object?
Hi, superbirds.
I think it is a good solution.
But you need apply client_to_canvas_coords function to X, Y (if you create non-FullScreen application). See part 3 of creating non-FullScreen web apps.
Blend4Web Team
kirill@blend4web.com
09 December 2015 19:49 #5773
ok thank you for the tip.
it works for the mousedown event
but i can't pick an object with the mousedover event.
is it possible?
09 December 2015 20:26 #5775
Hm.
I think you can use mousemove event. JS interpreter executes a code only once with mouseover event (moving the cursor onto container).
Blend4Web Team
kirill@blend4web.com
10 December 2015 08:20 #5782
ok, it works now with the mousemove.

Thank you.
 
Please register or log in to leave a reply.