• 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 amincahcepu · Apr 14, 2011 at 03:09 PM · guitexturepositioning

How to positioning guitexture always in the center ?

hi, i try to make a guitexture (like popup) that shown after a collect something

the thing that i've done, is parenting the texture to my camera GUI,i positioned it in inspector panel, but if the layer aspect is different, my teksture does'nt center, it's like drawn from the left alignment,

what must i do?

Update:

I must UN-Child

the GUITEXTURE first to ROOT and edit the inspector panel

transform : X: 0.5 Y: 0.5

Pixel inset

X : -(sizeWidth/2)

Y : -(sizeheight/2)

width : width

height :height

and below is up to you thank for FRHAYWORKS for the answer

Comment
Add comment
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

1 Reply

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

Answer by FrHaYwOrKs · Apr 14, 2011 at 03:16 PM

I'm using a lot of GUITextures centered by setting their position to 0.5 X and 0.5 Y (GUITexture's position spans from 0 to 1 with 0 is the left edge and 1 the right one) and setting the pixel inset to -(size / 2), so the position 0.5/0.5 will be referred to its center.

For example if you have a texture 300x200 you should position it at 0.5/0.5/0 (Z is for layering more textures) and set the pixel inset to -150 X and -100 Y...

I hope this can help you... :)

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 amincahcepu · Apr 14, 2011 at 03:46 PM 0
Share

i tried but it like vanished from camera view http://a4.sphotos.ak.fbcdn.net/hphotos-ak-snc6/208583_1946876278771_1448478888_32255206_3636079_n.jpg that's my printscreen..

avatar image amincahcepu · Apr 14, 2011 at 03:55 PM 0
Share

I'm sorry it work now, i must UN-child it first, so it wil work.. thanks

avatar image FrHaYwOrKs · Apr 14, 2011 at 03:57 PM 0
Share

Glad to hear it works for you now! ^^

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

GUITexture placement 1 Answer

Reduce Draw call for Multiple GUI Textures with same Texture 1 Answer

Android tablet 10.1 and guiTexture gui placement with unity 0 Answers

GUITexture Design-time positioning problems 1 Answer

GUI behind a 3D model 3 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