Search Unity

Question Simple scaling of TMP object based on screen-device width (pixel resolution)

Discussion in 'UGUI & TextMesh Pro' started by eco_bach, Apr 11, 2021.

  1. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    For a client demo that is targeting both desktop and Android I need a very simple way to scale down a TMP object if the target device resolution is less than a specific threshold width..

    I am targeting a with of 1080p so if the device resolution is less than this I simply need to scale down (font size?) the TMP object accordingly.

    Any TMP experts able to tell me the simplest way to accomplish this?
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I would recommend scaling the objects as opposed to altering point size.

    For instance, if you are / were using the Canvas system, you would use a Canvas Scaler to control the scaling.