Search Unity

Unity UI How to write user customizable UI?

Discussion in 'UGUI & TextMesh Pro' started by hsjaaa, May 30, 2019.

  1. hsjaaa

    hsjaaa

    Joined:
    Apr 30, 2016
    Posts:
    29
    I have a scroll view of a text mesh pro UGUI display game log, want it to be shrinkable and expandable, or the user could adjust the size of the scroll view. Any idea how to write that? Thanks!
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,778
    Not sure if there is UI out of box solution.
    But I know, the one feasible solution is using embedded browser, and make UI in HTML5, or atleast in js.
     
  3. hsjaaa

    hsjaaa

    Joined:
    Apr 30, 2016
    Posts:
    29
    Using embedded Browser feels too complicated and overkill for a small feature.
    Feels like there could be a solution using native UI and code control, detect mouse on certain area of the UI and use mouse drag event to change the width or height of the UI.
     
  4. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,778
    I suppose, you can use canvas and panels.
    Just record current mouse position on 2D plane of camera.
    For example you can make invisible button, as large, as each UI panel.
    Then scale panel, accordingly, to mouse movement, when mouse button is held.