Search Unity

how to fix position of the guitexture on the screen?

Discussion in 'Scripting' started by pretender, Sep 5, 2011.

  1. pretender

    pretender

    Joined:
    Mar 6, 2010
    Posts:
    865
    i would like to have their positions based on Screen.width/height so that they do not move
    when screen resizes, but their position is in world coords. any ideas how to do it?
     
  2. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,572
    GUITexture positions should be in screen coordinates (range 0.0 to 1.0). Something is wrong if they are not.
     
  3. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Those are viewport coordinates (screen coordinates are pixels), but yes, a GUITexture at (.1, .5) is 10% of the screen width from the left and 50% of the screen height from the bottom. Definitely not world coordinates.

    --Eric