Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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.