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
0
Question by Lumind · Mar 23, 2014 at 09:10 AM · spritescalesizengui

NGUI sprite size

Hi, I have a problem with ngui sprite. After I click the button - sprite1 changes to the sprite2. Then I click again and sprite2 changes to sprite3 and so on. It works, but sprite2 comes lower, it's picture size becomes bigger (however, no changes in transform are shown). In fact, I can't even properly say what exactly changes. How can I prevent it? before:alt text

after:alt text

before.jpg (174.4 kB)
after1.jpg (186.0 kB)
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 Simon-Larsen · Mar 24, 2014 at 02:03 AM 0
Share

I'm not sure I'm completely onto your problem. But I noticed the two sprites in your images are not the same size. $$anonymous$$by that is your problem?

avatar image Lumind · Apr 07, 2014 at 03:49 PM 0
Share

yes, that's the problem. well, than. before adding those to ngui atlas - sizes of pictures were the same 454x340, also, they had empty space(transparent). but after adding - ngui cut that empty place and size reduced. what can I do?

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Sisso · Apr 07, 2014 at 05:34 PM

Like @Simon Larsen said, both images have different size but you are showing in same size, so it need to be scaled. In atlas object you can manipulate sprite size, border, etc.

For a better GUI you should use texture images in same size in pixel that you will render. Sprites have MakePixelPerfect() method that rescale its object to correct size when you change it.

Comment
Add comment · Show 3 · 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 Lumind · Apr 12, 2014 at 08:38 AM 0
Share

all images were 454x340 before adding to atlas. after adding to atlas ngui cuts their transparent place as much as possible (before touching solid color). so the first sprite now is 454x155, second - 454x188, third - 454x221. only the last one (the biggest) remained the same - 454x340. I tried to change Height of Outer Rect from 155 to 320 and as the result - it grabs the second spritealt text

or maybe I don't understand what to do?.. :(

mess.jpg (193.6 kB)
avatar image Sisso · Apr 14, 2014 at 01:31 PM 0
Share

Which NGUI version are you using? Appear to be a very old one.

PS: I receive only now the comment notification from unity3d answer.

avatar image Lumind · Apr 14, 2014 at 04:07 PM 0
Share

yeah, seems to be old. I thought it was the latest, but it appeared to be 1.60 what $$anonymous$$imal version on NGUI do I need to make that thing work properly? (if that is a problem)

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

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

NGUI resizes fine in engine but not on actual devices 1 Answer

NGUI sprite scale aspect ratio 0 Answers

Help finding the right scale for an icon inside a backgorund sprite 1 Answer

How to align the bottom of a GameObject with the ground? 1 Answer

why the real size of a object doesn't show in the inspector? 0 Answers


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