Home › Forums › Bug Reports and Feature Requests › FPS camera does not work with ifame
- This topic has 16 replies, 4 voices, and was last updated 4 years, 1 month ago by Yuri Kovelenov.
-
AuthorPosts
-
2019-04-12 at 9:41 am #13819zjbcoolCustomer
when I use iframe embedding a FPS camera scene,I can not use wasd contrl the movement of camera. Is it a bug?
2019-04-12 at 10:01 am #13820elkCustomerHi zjbcool.
I use this little snippet for now;
app.ExternalInterface.reFocus = function(){ var target = parent.document.querySelector("iframe[src='your_app.html").focus(); }
Just call this from your puzzles when you need to refocus your iframe. Like after you press a html-buttons and maybe right after your app is initialized.
(Actualy; You probably don’t need the variable, so you can probably remove “var target = “)
Been a little while since I implemented this, so if the Verge3D team has a better way to do it now I would also like to know.
2019-04-12 at 10:09 am #13824zjbcoolCustomer@elk Thanks for your advice, I will try.
2019-04-12 at 10:18 am #13825elkCustomerNo problem Let me know how it works out, and maybe the Verge3D team can fill inn if there is a better/more recommended way of doing it.
2019-04-12 at 1:32 pm #13829zjbcoolCustomerHi elk.
It’s working now.Perfect!2019-04-12 at 1:41 pm #13831elkCustomerGreat. Glad it worked for you. I only tested on my regular desktop browsers so far, so let us know if you find any issues, but i think it should be fairly robust. I got the basic code from some other post on her, so might be good to do a search here to if you get any issues.
2020-09-18 at 8:49 pm #33040Massimo SpicaCustomerEhy guys, I implemented the snippet on a pressed interface button but focus of keyboard doesn’t work. Just the mouse.
dunno how to do, can you help me somehow?
2020-09-19 at 9:57 am #33050Yuri KovelenovStaff2020-09-19 at 10:28 am #33055Massimo SpicaCustomerhi!
here the link. It’s as simple as possible, i made this just to understand this bug.https://cdn.soft8soft.com/AROAJSY2GOEHMOFUVPIOE:eefbc26a42/applications/my_awesome_app/index.html
i put here the whole application and a screenshot, hope you can help me :D
Attachments:
You must be logged in to view attached files.2020-09-19 at 10:29 am #33058Massimo SpicaCustomerthis is the whole application
2020-09-19 at 12:12 pm #33061Yuri KovelenovStaff2020-09-19 at 12:27 pm #33062Massimo SpicaCustomeri did it, check the puzzle, doesn’t work anyway
i put the name of my app.html, in that case my_awesome_app.html, assuming the your_app.html of the snippet was generic. correct?
2020-09-19 at 1:30 pm #33064Yuri KovelenovStaffthat’s strange, because the scenario in the linked app still refers to
your_app.html
2020-09-19 at 9:21 pm #33069Massimo SpicaCustomermaybe i changed it later for mistake. Now in visual_logic.js is my_awesome_app, but still not working.
2020-09-20 at 9:24 am #33075Yuri KovelenovStaffI see. This is because such the configuration just registers the function but does not execute it. It worked for me after I placed the only exec script puzzle in the main Puzzles tab with the following line in it:
parent.document.querySelector("iframe[src='my_awesome_app.html']").focus();
-
AuthorPosts
- You must be logged in to reply to this topic.