Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

GuiText screen resolution

Discussion in 'Immediate Mode GUI (IMGUI)' started by FraMarSaMi, Jun 9, 2014.

  1. FraMarSaMi

    FraMarSaMi

    Joined:
    May 13, 2014
    Posts:
    86
    Good morning, how can I create a GUIText that not resize it and not move also if the screen resolution change?

    Thank you
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,398
    Uncheck "pixel correct", don't use any pixel offset values (all 0), use scale to change size and x/y transform position to change location on screen. One thing to be aware of is that different aspect ratios will squash/stretch the text a little, unless you write some code to prevent that.

    --Eric
     
  3. FraMarSaMi

    FraMarSaMi

    Joined:
    May 13, 2014
    Posts:
    86
    Thank
    Thank you for the answer...there is an exemple of the code for not squash/stretch the text? For GuiTexture I have used GUITexture.pixelinset for to have the same dimension if change the screen resolution, there is any function as it? Thank you
     
  4. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,398
    Compute the screen width/height ratio, and change the transform.localScale.x accordingly.

    --Eric
     
  5. FraMarSaMi

    FraMarSaMi

    Joined:
    May 13, 2014
    Posts:
    86
    Ok I try it thank you !