- Home /
Screen.width + Draw Texture not screen width
i use GUI.DrawTexture and Screen.width/height to fill the screen with a texture, but Screen.width gives me Screen.width - 1.
even when i write Screen.width + 1 in code i can't get it to fill up the last vertical row of pixels.
Answer by Chesley · Aug 29, 2012 at 12:10 PM
i found out that this is an editor bug
i'm not sure in it... still want to know way to reproduce that...
Answer by ScroodgeM · Aug 26, 2012 at 07:48 PM
may be your texture aspect ration is different a little to screen aspect ratio and it fits vertically but not enough for 1 pixel to fit horizontally?
but i stretch it with: Scale$$anonymous$$ode.StretchToFill, would that problem be solved? or is stretching still limited?
show whole line with GUI.DrawTexture, and a pic if you can
GUI.DrawTexture(Rect(0,0,Screen.width,Screen.height), WhiteTexture, Scale$$anonymous$$ode.StretchToFill, true);
line
pic is just a 256x256 white square
r u sure your texture doesn't have alpha value on edge? and on left edge too?
yes im very very sure, also i tested it by doing Rect(0,0,2000,2000) and it STILL leaved the line
Answer by hdgam3r · Aug 26, 2012 at 08:35 PM
Check your texture´s import settings on the inspector:
Make sure that the Texture Type is set to: GUI
Make sure that the Max Size (default 1024, I think) is enough to fill your screen size.
already tried that. didn't work. still thanks for the response
Just to be sure, is your Game window set to a specific resolution ins$$anonymous$$d of Free Aspect?
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Limit on GUI Components? 0 Answers
How To Make Ammo & Realod for Gun & Spark for Gun ? 0 Answers
Drawing a GUI.DrawTexture call above GUI.Button in seperate scripts 0 Answers
GUI.DrawTexture isn't centred. Help? 1 Answer