I’m having problems getting this to work (outside Unity Editor).
What i do, is i add a GUITexture, and i place everything at zero, Position, Rotation, Scale and Pixel Inset (x,y), only the width and height have a value, in this case (100,100).
Then, in code i position the GUITexture like this :
This code works great, and i can change resolution inside Unity Editor, and the GUITexture position adapts perfectly.
However, when i make a build, and run the game outside of Unity, my GUITexture doens’t position itself correctly in the Y axis, it gets either higher or lower, but not in the desired position.
Anyone spots an error here ?
Well, with the position i can’t find the exact place where to place it :?
If i use the position, i have values between (0,1), and the moment i change resolution, the position is diferent.
That’s why i was using pixel values, because with pixel i can know what screen resolution i’m on, and adapt the position depending on those values.
How would you use the position, if it changes when i change resolution ?
And, how do you check the alignment and the center of the texture ?
Well, i did as you sugested, but doens’t work either
I measured position.x, and position.y, with a resolution of 1280x800.
In that resolution, the position coordinates are (0.362,0.34).
When i change resolution, as expected everything gets out of it’s place.
So, i did this :
Where do you want to put your texture? what you have to do is to play with the values that are being divided (in this case Screen.width/2 and Screen.height/2).
Thanks,
This is really bizarre, your technique does work, but only in the Y axis, the X axis gets all messed up.
So, i made a mix of the techique i pasted initially, and a mix of yours, the original one for the X,and yours for the Y, and now works, but still, doens’t look clean, lol