Search Unity

WebGL IMGUI doesn't support touch

Discussion in 'Web' started by monark, Nov 17, 2017.

  1. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    Since IMGUI is all set up to work with touch on mobile is there any solid reason why it doesn't work with WebGL?
    It's still fantastically useful and quick to put stuff together with plus there are loads of legacy UIs out there that could make use of it.

    As follow up question, assuming the answer is we have no plans to support this in WebGL we want to force you to use the new one, is there a workaround to extend IMGUI to add touch support, it naively seems trivial to do but I don't think you can get access at a low enough level as a user.
    The only way I can think of off the top of my head is to put a wrapper around every GUI method and has a touch implementation to go with it using my own code. But that would still require a lot of refactoring of code to make use of.
     
  2. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    One thought I had as a work around, on an input touch create a new mouse down event and in OnGUI swap the current event for the made up one so imgui thinks it got a mouse click, could that work...
     
  3. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    Hmm seems to use it's own internal code to check for mouse clicks on buttons, very frustrating.