Search Unity

responsive webgl player and center in div?

Discussion in 'Web' started by tswalk, Jun 11, 2018.

  1. tswalk

    tswalk

    Joined:
    Jul 27, 2013
    Posts:
    1,109
    I'm having troubles doing much of anything to control the layout of the div in my html. I would really like to be able to have some kind of responsive layout with a div that is dynamic, conforms to a specific aspect ratio, and will adjust as the browser window is resized.

    However, ever thing I've tried is failing. I even went so far as to attempt to modify the free addon provided by Simmer.IO and while I am able to get it to somewhat adjust the layout, the camera view gets horribly skewed in the unity player.

    I'm using Unity 2018.1.0f2

    There is very little documentation related to how to do this (if any at all that I've found)... is there any examples on how to do this?
     
  2. tswalk

    tswalk

    Joined:
    Jul 27, 2013
    Posts:
    1,109
    ok, so after a visit to some Simmer.IO unity published games.. i got something working. It is super hacky ;) literally without Simmer.IO I really would not have been able to get as far as I have.

    Anyway, still having an issue after resizing where the camera in the player gets offset.. I'm sure I'll be able to debug in console, and come up with something just as hacky in Unity after detecting the screen size changes (got that working anyway), but still... this seems to be so much harder than it should be IMO.

    I'm honestly impressed that Simmer.IO got this working at all .. seriously.
     
    artdoctorka likes this.