Jump to content

2D UI in WebVR?


dinod
 Share

Recommended Posts

Total Babylon noob here looking for some help!

I'm working on a WebVR game and want to add in some 2D elements like a small "Press the A button to start" box.

How would I go about something like this? I've played around with Canvas2D but for some reason have only been able to get it to show the 2D element through one eye of my headset and have since scrapped that idea.

Any ideas for the best way to go about this would be much appreciated! :) 

 

Link to comment
Share on other sites

I suspect you tried to use the screenSpaceCanvas. It's expected that it is only visible on "one" eye as it's positioned relative to the screen, which is "split in half" for VR, and not to the scene. I prepared an example utilizing the worldSpaceCanvas that shows canvas2D elements on both eyes ;)

http://babylonjs-playground.com/index.html#NJBBC9

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...