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
0
Question by humpalum · May 16, 2018 at 03:07 PM · uibuttonui image

Adding Images to Prefabs,Adding Images to prefab

Hello together,

i got the following Problem:

We use button prefab for our UI elements. However, we now want to add a image field to the prefab, that we could later use to show a thumbail of objects.

Im not sure if you can do anything with it, when i just post the prefab as is here, but you can find the prefab we use here: https://pastebin.com/bL379YFd

We now have troubles, to edit the prefab, so that a Image can be shown next to the buttons label.

So the steps we tried:

  1. "Instantiate" the prefab by dragging it in the Scene.

  2. Add a "UI -> Image" to the Scene

  3. Drag the Image to the Button, so that it is the parent of the Image.

  4. Set the Texture of the image to actually see something.

And this is the part we having the troubles. We cannot get any image to show on the Button :(

What are we actually doing wrong, can anyone point this out to us?

I will fill the Question with Pictures later, to clarify what we are doing. Just cant do it now, since i don't have direct access to a Unity instance right now.

Comment
Add comment · Show 3
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 Harinezumi · May 16, 2018 at 03:34 PM 0
Share

Try setting the RectTransform of the image to fill the area of the Button: click on the rectangular icon in the RectTransform, select the bottom right option to match anchors to parent, and then set all the 4 values (left, top, right, bottom) to 0.

avatar image humpalum Harinezumi · May 16, 2018 at 05:26 PM 0
Share

Sadly, this didn't help.

Is there any more information i can give so we could work this out? alt text

avatar image Harinezumi humpalum · May 16, 2018 at 10:00 PM 0
Share

I don't have any idea other than to make the image the same size as the parent button object. Stupid question, but to make sure, the texture is set to be a sprite, right?
Otherwise, could you post screenshots of the settings of the Button and the Image? $$anonymous$$aybe that will help. Btw, this is what I've meant how to set up the RectTransform of the Image:
alt text

capture.png (11.2 kB)

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

148 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 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 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 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 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 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 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

UI button are sliced after exporting 0 Answers

How to Change Menu Button Rollover States with GameObjects 1 Answer

UI image with button component not tracking mouse correctly 1 Answer

How do you handle a scaledown animation on a UI button? 0 Answers

unity 2017 UI Delay bug 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