Image scaling in unity - complete beginner
Hello guys, I have a question about scaling images . I have problem that my images are not scaling, when choosing different resolution. I see that when i change to different resolution, my pictures position stays the same which for sure is not correct. My question is how to manage that? I really tried and nothing works. Here i attach screens from game so you can see. I will be happy for any answer. Thanks!
and here it is after changing resolution
Answer by toddisarockstar · Apr 10, 2017 at 12:00 AM
Texture2D t;
t=new Texture2D(1,1);
void OnGUI(){
int x = Screen.width;
int y = Screen.height;
GUI.DrawTexture(new Rect(x*.25f,y*.25f,y*.5f,y*.5f),t);
//image height and width will allways be half of screen height
}
Your answer
Follow this Question
Related Questions
Application.isShowingSplashScreen confusion 0 Answers
Playerprefs are not deleting when an apk is uninstalled? 0 Answers
Getting crash on specific devices? 0 Answers
Horizontal Input showing random decimal when it should be 0 0 Answers
On collision with enemy slow player down while inside the collision box, else normal speed. 0 Answers