Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 bigticket21 · Aug 31, 2015 at 02:14 PM · uiui imagehierarchy

uGui image element doesn't render

I'm making a menu for my current project. On one of the buttons, I'm using an image child instead of a text child. It renders behind the button for some reason, until I move it about 15 pixels or so.

Hierarchy looks sort of like this (oversimplified):

1. Canvas Set at screen space - camera and attached to the main camera. Also has a graphic raycaster and canvas scaler. Canvas scaler is set to scale with screen size, matching 1280x720 resolution, matching it at 0.5 (the middle).

2. Menu holder The menu holder is the parent to the whole menu's "sections". It has the background image attached to it. It has a vertical layout group so everything inside is placed according to their LayoutElement properties. It has the menu's script attached.

3. Different menu elements Different game objects for each menu "section", e.g. one GameObject for the header, one GameObject for the scroller where the game spawns buttons, etc. Each has a LayoutElement component attached and different properties on it.

3.1, CloseButton A button that closes the whole menu. It has a LayoutElement attached and "Ignore layout" is checked so I can position it in the top right corner without moving it up the hierarchy (so it's the bottom most object, thus being rendered in front of everything. OnClick event is MenuHolder.SetActive(false);

4. CloseImage A child of CloseButton, a simple image that has an icon. It's stretched horizontally and vertically so it matches the CloseButton's size. It's there so I can use the image on CloseButton in other places as well.

So, in short, CloseImage is a child of CloseButton, which is a child of MenuHolder, which is a child of the canvas. CloseButton is ordered last in the hierarchy, so CloseImage being a child, is the last ordered element in the hierarchy.

It just doesn't render. If I move it with the Rect Handles tool, it renders even before exiting the borders of the parent button: Strange

Anyone encounter this problem? For me, it happens in one other menu, which has basically the same structure, and nowhere else, even other similarly ordered menus.

I'm using Unity 5.1.0. At home, I tried with 5.1.2, same results.

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

0 Replies

· Add your reply
  • Sort: 

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

2 People are following this question.

avatar image avatar image

Related Questions

Script Repositions UI Element in the Wrong Spot 0 Answers

UI Image not appear in mac / ios 1 Answer

Transform translate not working properly in Canvas 0 Answers

Problem when scrolling through inventory slots 0 Answers

UI Image dublicated and cant be deleted. 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