Search Unity

How to display a web browser in game...

Discussion in 'Scripting' started by dvochin2, Jan 12, 2013.

  1. dvochin2

    dvochin2

    Joined:
    Jul 14, 2012
    Posts:
    84
    Hi all,

    Is there a way to display a web browser during gameplay (PC standalone build, not web player) (Note that this is the inverse of running Unity inside a web page via the web player...)

    As Unity game runtime gets DirectX 9/11 to render its window I gather setting a web browsing HWND to display on top would not work, but maybe one of these two alternatives would work?
    - Create an in-game object with a dynamically-created Texture2D that gets its pixels from a background web browser window.
    - Hook into directx post render and 'paint' the current image from a background web page rendered in a background window
    - Build WebKit in a DLL and find a way to paint its window on top of DirectX

    (While the above would render the web page in game I will of course have to send Unity mouse clicks and keyboard edits to the background web browser for it to update...)

    Has such a feat ever been accomplished?

    Any ideas?

    Thanks! :)
     
  2. Cameron_SM

    Cameron_SM

    Joined:
    Jun 1, 2009
    Posts:
    915
  3. dvochin2

    dvochin2

    Joined:
    Jul 14, 2012
    Posts:
    84
    Hi Cameron, thanks for that heads up... looked in the asset store for 'browser' and getting no results made me think it doesn't exist.

    There turns out to be a fantastic implementation of WebKit running brilliantly inside Unity games made by Mythos Labs here. Don't know why such a well done project can't be found on the Asset Store...

    uWebKit appears very well done and more than exceeds what I need to do in-game... Check it out! ;)
     
    Last edited: Jan 12, 2013
  4. nomax5

    nomax5

    Joined:
    Jan 27, 2011
    Posts:
    365
  5. CodeHeadPro

    CodeHeadPro

    Joined:
    May 3, 2020
    Posts:
    1
    Why not just make a form in VS to be your game launcher/patch-updater. Make it to launch the game, and updating it from a web site. A lot of games use a web site to patch their games.

     
  6. Ismawell

    Ismawell

    Joined:
    Oct 19, 2018
    Posts:
    4
    Did you find the answer?? I am on the same situtation, i do not understand how this simple thing can be so difficult
     
    CloudyVR and AuraCS like this.
  7. CloudyVR

    CloudyVR

    Joined:
    Mar 26, 2017
    Posts:
    715
    I am also interested, are there any solutions that work in the UI so I can add a simple web view to a VR game?
     
  8. TheJam3s

    TheJam3s

    Joined:
    Aug 25, 2021
    Posts:
    3
    CloudyVR likes this.