|
I have several GUI button images that look fine on Windows, but on the Mac are squeezed down to at most 50 pixels wide no matter what I do. The buttons are all PNGs created with GIMP and a little transparency around the edges, and most of them display fine except for this one particular set of 384x128 images that I'm trying to display as 128x50:
When played in the Mac editor (and any builds created by it), it ends up being scrunched width-wise down to 50 pixels:
The code is essentially: So far I have tried:
It thus seems to be independent of my code that's drawing it, and even overriding the GUIStyle. So far I'm not seeing a difference between the images it does it to and the rest that are displayed fine, so it's pretty whacked. Has anyone encountered this?
(comments are locked)
|
|
The problem seems to be limited to using an image as the GUIContent argument of GUI.Button, the workaround that ended up with acceptable results was just to make a totally new style for each button (a dozen in my case), and use the image as the "Normal" background of that style.
(comments are locked)
|
|
The reason is that you have set values for the button sizes. Instead use a dynamic size. You will have to play with the sizes, but you get the idea. This way you will have the same relative size no matter what the screen size is. Thanks but the issue is not the difference in screen resolution. I have this at the beginning of OnGUI, telling it to behave as if the screen is 1024x768 in all cases:
The problem is that, even when hard-coding the width to a certain number of pixels which it should display it as regardless of screen resolution, it always cuts it down to 50, proportionately less.
May 31 '12 at 08:39 AM
blitzen
(comments are locked)
|


