Home › Forums › General Questions › Cursor hand
Tagged: Cursor, hand cursor, rollover, visual_logic.js issue
- This topic has 22 replies, 2 voices, and was last updated 6 years, 7 months ago by Yuri Kovelenov.
-
AuthorPosts
-
2018-03-19 at 11:55 am #2986NewFakeCustomer
Hi,
is there, please, a way to show the hand cursor on rolling over objects?
NewFake :)
2018-03-19 at 3:43 pm #2996Yuri KovelenovStaffHi,
Sure you can do it with ExternalInterface. Inside your_app.js find the prepareExternalInterface function and register a function with
document.body.style.cursor = mode;
inside it:function prepareExternalInterface(app) { app.ExternalInterface.cursorSet = function(mode) { document.body.style.cursor = mode; } }
Your puzzles can look as shown on the attached image.
Here is the exhaustive list of all cursor types
https://www.w3schools.com/jsref/prop_style_cursor.aspAttachments:
You must be logged in to view attached files.2018-03-19 at 4:56 pm #3002NewFakeCustomerHello!
I don’t see neither a “prepareExternalInterface” function in my_app.js file, nor a “when hovered” puzzle in the puzzles list.
Kindly please elaborate. What should I do to get that function showing up?However I guess that this puzzle probably shows up when the function is added? As by default I don’t see it in the puzzles’ list.
NewFake :)
2018-03-20 at 8:00 am #3014Yuri KovelenovStaff2018-03-20 at 6:04 pm #3024NewFakeCustomerHi Yuri!
Yes I’ll wait, thank you.
NewFake :)
2018-03-27 at 11:25 pm #3199NewFakeCustomerHi Yuri!
I installed Verge 2.2 for Blender.
I did exactly what you mentioned: the function inside the function the way it’s showed in the comments of my_app.js file, the “hovered” puzzle setup, saved, but my cursor doesn’t change to pointer; I also tried other kinds of cursors…
I run FireFox latest version, I keep on cleaning my cache with ctrl f5… Any idea please?NewFake :)
2018-03-27 at 11:43 pm #3202NewFakeCustomerI also tried in Edge, with the server on, no cursor change; same on launching the html file of the app.
NewFake :)
2018-03-28 at 8:14 am #3207Yuri KovelenovStaff2018-03-28 at 5:24 pm #3228NewFakeCustomerHi Yuri!
Thank you! Yes I get the cursor “hand” in your app, sniff…
If it’s not due to the JS nor the puzzle would it be in my Blender file?
Do you please see any special setting to be implemented in it in order to having that cursor function working fine?Checked and found! It’s coming from the visual_logic.js file.
I pasted yours into my app’s one; I just changed the object name in it and it works fine, I get the hand cursor!
Now of course comes the question: why?
Why on my system that file, the only one I changed manually, isn’t written the right way?Here attached the visual_logic.js file exported from my system for you to scrutinize it.
NewFake :)
2018-03-28 at 6:30 pm #3232NewFakeCustomerHere the exported problematic visual_logic.js JS file.
A difference I see in that visual_logic.js file is on line 26
Yours: var mode;
Mine: var x, cursorSet, mode;My install also writes something wrong around line 197: “ALL_OBJECTS”; (it’s the name of all my 3D objects), alone on that line…
The question of course is why those differences, and others that I most probably didn’t see because if I change only those two lines it still doesn’t work, I must paste the whole file of yours to having my cursor displayed, and change my objects’ names of course.
Every time I save my puzzle it of course rewrites the JS file with errors.NewFake :)
2018-03-28 at 8:12 pm #3242Yuri KovelenovStaff2018-03-28 at 8:25 pm #3247NewFakeCustomerHi Yuri,
Thank you, please check again the attached JS file above as version 2 contains the JS error on line 197, as version 1 didn’t contain it.
My project is much too heavy for me to attach it here, objects and equirectangular file. I’m going to reproduce it on a lighter app and either upload it here if not too heavy or send it to you by email.
NewFake :)
2018-03-29 at 8:00 am #3251Yuri KovelenovStaff2018-03-29 at 4:55 pm #3268NewFakeCustomerHi Yuri!
I put the above file, puzzles.min_-4.js, inside the “puzzles” folder after having renamed it to puzzles.min.js of course, and no, it doesn’t work; it doesn’t generate a correct visual_logic.js file, no hand cursor…
The visual_logic.js file which works fine is the one you sent me in your my_awesome_app2.zip that you uploaded above.NewFake :)
2018-03-30 at 9:07 am #3279Yuri KovelenovStaff -
AuthorPosts
- You must be logged in to reply to this topic.