Hello, How can I make a scene(a menu), only run in a certain resolution? I want this because my menus look best at a certain resolution, and look horrible and distorted in others. ![]()
Thanks
Hello, How can I make a scene(a menu), only run in a certain resolution? I want this because my menus look best at a certain resolution, and look horrible and distorted in others. ![]()
Thanks
are you using absolute positioning? you can do some math with the Screen.height and Screen.width stuff, but if you dont want to change it, Unity - Scripting API: Resolution use the âheightâ and âwidthâ stuff in the Awake function
You donât want that, because people use all sorts of different screen resolutions and generally donât want to be stuck with just one, since itâs good odds it wonât match whatever screen theyâre using. Program your menus so they work in any resolution.
âEric
How do i do that? I have a script that changes the ratio to match screens(1:3365), but, it only looks good up to about 1280x990(something like that) resolution. higher than that, the background image goes distorted. ![]()
you mean the image sets all pixely, or it gets stretched, or something?
It gets stretched. ![]()
hmm. can i see the script
Scale(ratio) script:
// Use this on a guiText or guiTexture object to automatically have them
// adjust their aspect ratio when the game starts.
var m_NativeRatio = 1.3333333333333;
currentRatio = (Screen.width+0.0) / Screen.height;
transform.localScale.x *= m_NativeRatio / currentRatio;
Hello?