Problem with texture size

Hello,
I need a little help: in response to the code:

GUI.Button(coordinates, texture, style)

The texture won’t stretch to fit the coordinates. I tried all possible settings in my Style, but without result.
Moreover, Unity says the texture is 64x64, which is not true, it is 93x61. If I open it with an external program, all right, but in Unity it is always shown as a 64x64 and won’t stretch further than this.

Any advice?

Thanks, Pasko

Save it as a different format and try again.

Ok, thanks. I tried it, with no positive result. They started as png, but changing them to tga or even jpg did not improve the situation.

only gui.label will stretch I think
or a corresponding button style could do so too

I would love to know the details of this style :slight_smile:
unfortunately the label won’t do (apart from going needlessly complicated).

Thanks for the attention, Pasko

guistyle which is set to stretch width and height potentially works.

I know that we decided against stretching for our case as the lose of quality was not acceptable.

you might also want to look into GUITexture to use real 3D stuff and let the texture filtering handle the scale

GUI.DrawTexture can be used to stretch textures exactly with their rectangle.

that would be new to me, it will use the rect yes but only draw the texture at its size in the top left corner. thats at least the behavior we saw prior U3 (not tested on U3)