Search Unity

4.6 UI Scaling

Discussion in 'Immediate Mode GUI (IMGUI)' started by Wrymnn, Sep 29, 2014.

  1. Wrymnn

    Wrymnn

    Joined:
    Sep 24, 2014
    Posts:
    380
    After several Hours with capital H I have been watching tutorials on 4.6 UI system.

    If you don`t wanna read the entire story, just watch this video to see the problem.



    Now I want to do simple healthbar with it. I have never been so angry with similar system.

    I don`t even know how to put it, but unless I put my health bar screen into exact rect transform, so corners of rect tansform (those triangles) are in the corner of my health bar Image, when I resize window, the healbar image scales as crazy, going off screen etc.

    When I wanna reposition my health, again The rect transform doesn`t even reposition with it. I have to again rpeosition 4 corners of rect transform and then exactly fit my UI healthbar into them so it doesnt stick out.

    I am completely hopeless there are like 5 tutorials in youtube of this new uber super UI system and ALL, ALL ,ALL of them show how to create simple static menu buttons, in static scene, when you just press buttons that all.

    How to make Complex UI system with crafting, inventory, tech tree etc. when I cannot even make stupid healthbar because bad designed rect transform is fighting against me every time I wanna change position of my healthbar UI.

    I have coded entire UI system in my previous game, but this horrible system just put me down after several hours.
     
    Last edited: Sep 29, 2014
  2. clownhunter

    clownhunter

    Joined:
    May 26, 2013
    Posts:
    61
    You always have the anchor set to stretch from the looks of it. Try setting it to top left or something and then nothing will scale/move.
     
  3. jim0_o

    jim0_o

    Joined:
    Jul 14, 2013
    Posts:
    6
    I'm having the same problem.
    I figured out the same anchor points fix for scaling but when I do this to buttons they stop working.

    (at least in my case on my Galaxy S4)

    If I set the buttons to not scale and adjust for size in the Editor they are minute on my phone.

    Would like to know if there is a different way or if this is just a Beta bug ...

    Ex. could I use % instead of Pixels to place and define the buttons and images ?


    Also will there / Is there a way to make a font in a text element scale with the Panel it is inside?