Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by falantar14 · Oct 09, 2014 at 07:16 PM · uiguiunity 4.6

Unity 4.6 GUI - Stretch/scale while rotated

I am having an issue where I have a Rect that is rotated 90 degrees and I want to make it scale along with the Canvas. I have set up the anchors just like I did with the non-rotated rects but when the canvas stretches horizontally, the rect stretches vertically and vice versa. This only happens with the rects that are rotated.

I have tried inverting the anchors (putting each anchor on the opposite corner, which gives it a slightly different effect but not the standard stretch/scale I'm looking for.

For certain reasons, I can't just leave the rect with no rotation and change the dimensions to make it look like it's rotated, which so far is the only way I've been able to make it scale properly.

Has anyone else encountered this or have any idea what I can do?

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image KpjComp · Oct 09, 2014 at 08:11 PM 0
Share

I'm not 100% sure what you mean here, I've put a panel on a canvas, and rotated the panel 45%, if I scale the canvas everything works as expected. Are you able to create a simple scene, and upload it here?

avatar image falantar14 · Oct 09, 2014 at 08:59 PM 0
Share

Ok but if you rotate it 90 degrees so that it's sideways and then stretch the canvas horizontally, the "width" of the panel stretches when I want the "height" to stretch.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Ryujose · Oct 10, 2014 at 06:04 PM

I'm not sure if I understood but maybe when you rotate 90 degrees. Canvas detect width when teorically is height and height when is widht?

Hope is that.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image falantar14 · Oct 11, 2014 at 04:29 AM 0
Share

Yes it is that, I just wanted to know if there was a way to change it.

avatar image YondernautsGames · Mar 20, 2015 at 06:10 PM 0
Share

I asked a similar question at http://answers.unity3d.com/questions/927105/simple-way-to-fit-rotated-ui-element-to-parent.html Worked out an answer for myself which might work for you

avatar image
0

Answer by Mulik · Aug 25, 2017 at 01:23 PM

First rotate as you want 1. set anchor to stretched 2. swap min x and max x 3. swap min y and max y

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity 4.6 ui scroll rect won't show up in fullscreen 1 Answer

Unity 4.6 UI - How to left-align scroll rect content 3 Answers

Oculus Rift virtual keyboard 0 Answers

Unity New GUI Buttons not resposive on Touch 1 Answer

How can I make a Unity 4.6 UI object trigger when I drag something onto it? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges