Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Making texture cover whole button

Discussion in 'Immediate Mode GUI (IMGUI)' started by pokobros, Mar 20, 2014.

  1. pokobros

    pokobros

    Joined:
    Jan 30, 2014
    Posts:
    119
    How do you make a 2D Texture cover the whole button? When I write
    Code (csharp):
    1. GUI.Button (Rect (0,0,50,50),texture);
    the texture turns out like this:
    $Screen Shot 2014-03-19 at 7.09.46 PM.png
    How do I make it so that the texture covers the whole button?
     
  2. TIGGYsmalls

    TIGGYsmalls

    Joined:
    Jan 10, 2013
    Posts:
    38
    I'm having the same problem.

    If your texture is small then it wont stretch to fill up the space.

    Dose anyone know if you can force the scale up on a GUI image? I've had to make it a texture in a style, but I'll proably run out of custom styles soon enough.