Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Logo/Emblem adjusting

Discussion in 'Immediate Mode GUI (IMGUI)' started by alexander, Jul 17, 2008.

  1. alexander

    alexander

    Joined:
    Mar 28, 2008
    Posts:
    180
    Hi
    don't know, which keywords I should search for this question.
    Have to create a application for individual skinning for several firms.
    Several firms have got their own emblems/logos which haven't the same format (take f.e. Renault with a diamond and f.e. Audi with the 4 circles in horizontal row.
    So, I get to do the perfect adjusting for ALL the logos in the whole world.

    I've got an available area of 190x75 px.
    So my 1st thought was to create to customStyles for
    if the width > hight take custom[1]
    else take custom[2]

    Is this the right way - the most complex way - the impossible way? :)

    Thx
    Alex
     
  2. shaun

    shaun

    Joined:
    Mar 23, 2007
    Posts:
    728
    We had to do something similar, which was create icons for arbitrarily sized images. We wrote a converter within Unity based on Get/SetPixels.
    I'm saying this assuming your customers would select a JPG logo from their hard disk, which could be any size, and you have to make it fit within a 190x75 space.

    The other way is just to check the size of the texture, resize the GUI.x control to match the longest edge and swap out the GUIStyle.normal.background texture. If they choose a 4Mb image however, this method is no good.
     
  3. alexander

    alexander

    Joined:
    Mar 28, 2008
    Posts:
    180
    Hmm, with Get/SetPixels I haven't done anything up to now.

    Try your 2nd way - hope I get it. :)

    Thx for now