0

I'm having a problem with that code:

rect = new Rect(saveTextures[0].width, saveTextures[0].height, saveTextures[1].width, saveTextures[1].height);
GUI.DrawTexture(rect, saveTextures[0]); 
if(GUI.Button(rect, saveTextures[1]){
    //do stuff
}

It should look exactly the same, and it does in editor. It also looks totaly the same on iPad2, but on iPad3 the top GUI.Button is scaled down to approximatly 90%.

Any ideas what could be the problem?

I make a simple example of the problem. Here is how it should look and looks on iPad2. Example on normal screen

And here is how it looks on retina screen: retina screen

The red part is the button, and it covers whole background on first but only like 90% on second.

gabrjan
  • 3,080
  • 9
  • 40
  • 69

1 Answers1

0

Make sure you set the texture type to GUI and that its max size is high enough (try 4096 if not sure).

Also noticed that your Rect constructor is a bit strange. It's new Rect(top, left, width, height), so you're using saveTextures[0] as top-left and saveTextures[1] as width-height while displaying them in the same position.

Krzysztof Bociurko
  • 4,575
  • 2
  • 26
  • 44
  • SaveTextures[0] and saveTextures[1] are the same size, so no diffrence which one do I use. It's max size is ok also. However texture type is sprite. Could that be a problem? Seems a bit weird for me... – gabrjan Jun 30 '14 at 14:07
  • I haven't used non-legacy 4.5 uGUI sprites yet, but as you're using this in the classic GUI system, I suggest using the legacy GUI texture mode. Also, is a screenshot possible? – Krzysztof Bociurko Jun 30 '14 at 14:59
  • I added example screens. – gabrjan Jul 01 '14 at 06:20
  • Pardon my scepticism, but the screens look a bit fake... Please Debug.Log the height/width/top/left values of the Rect and width/height of both textures on ipad2 and ipad3. Maybe that will say something about the issue – Krzysztof Bociurko Jul 01 '14 at 10:22