Big Image

I’m trying to display a very wide image ideally it would be draggable with horizontal limits so only the image can be panned, and not infinity - if anyone can suggest an asset / script for that great, otherwise a slider I guess.

The problem comes down to the quality of image, I see other people online ran into this for large images but it was prior to Unity 5, the quality is terrible once it’s imported - I tried making it a square, but no difference.

The resolution seems better as a texture on a plane / flat cube but I’m not sure this is the best approach rather than a UI Image.

Any suggestions?

If the image has less quality as a UI image, it’s probably because your canvas is a smaller resolution than your screen. Because of that, your high-quality image gets rendered to a low-quality image (the canvas), then that low-quality image gets rendered to the screen.

On your canvas, there should be a “canvas scaler” object. Set the scaling mode to “Scale with screen size” and enter a “reference resolution”. I recommend using your current resolution for the reference resolution, and don’t worry, the UI will still fit screens of different sizes.

1 Like

Thanks, your help lead me to try the iOS override, I changed the max setting and it’s perfect.
I take it the image has to be square when it’s create?

Also, any suggestions to drag the image horizontally within set limits?

Thanks.

I don’t think the image has to be square… just make sure the texture isn’t getting compressed to a smaller size in the inspector when you select it. It’s slightly more efficient to have square textures with a resolution that’s a power of 2 (256x256, 512x512, 1024x1024, etc.) but it’s such a small optimization that I wouldn’t worry about it unless you have a complex 3D scene with many textures.

As for the scrolling, I’m afraid I haven’t done scrolling in UI… I could help you figure it out in 3D but it’s probably much simpler if you figure out how to use a UI ScrollRect or something. This tutorial looks good, but keep in mind it was made in Unity 4.6, so there may be a few things that are old or different.

1 Like

Thanks a lot.