menu images are scaling wrong?

Updated on February 22, 2017 in [A] GUI
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
9 on February 22, 2017

Hey guys I got a weird problem so I am making a remake of plants vs zombies and working on the main menu dunno why its such a pain in the ass so far. I drag a picture into the Hierarchy and when check it out on game looks fine and even when I launch. But when I go to  “Maximize on play”, It’s in the wrong position. I don’t have a canvas atm just the main Camera.

  • Liked by
Reply
3 on February 22, 2017

How do you not have a canvas? Are you doing all the menu in code with OnGUI ?

Wise
on February 22, 2017

I do for the buttons but I meant just the images.

Devoted
on February 22, 2017

Yikes. That’s rough…
So the picture you drag into the Heirarchy, What kind of Object is it? A sprite, Image, Quad, 3D Model…?

Wise
on February 22, 2017

Sorry I should of been more precise. Lets do it this way, I have the background for the game (its not attached to the canvas) now I have a canvas with a button, I put the button on this grave stone image looks good in scene view and even in game view. I maximize the game and now its not in the correct spot. Maybe the image is stretching?

Show more replies
  • Liked by
Reply
Cancel
4 on February 22, 2017

Well I got good news sorta lol. I set the Camera to world space and its perfect don’t know how this changes it?

Devoted
on February 22, 2017

By “camera” you mean “canvas” right?

Wise
on February 22, 2017

Oh yeah my bad the canvas not camera xD

Devoted
on February 22, 2017

That makes sense because in canvas space, UI objects get scaled according to transform components, anchors and screen sizing, whereas, in World space, UI elements are placed and scaled only according to transform components so what you see is what you get.
I don’t have a thorough understanding of these two differences, though, unfortunately. Glad you got it sorted out.

Wise
on February 22, 2017

Yeah same thanks for help.

Show more replies
  • Liked by
Reply
Cancel