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 SuperMasterBlasterLaser · Nov 04, 2014 at 06:27 AM · uilistmaskoffset

New UI listView

Hello.

I have script that downloads JSON from server then parses it to my classes. Now I want to create list of buttons that will scroll down.

I have created panel with Scroll rect component. Added Mask. Created new panel and made it child of my scroll rect panel and it will be my content. Anchors will strech to its parent.

I have created somewhere else (in canvas) button with images and texts. Anchors set to middle of canvas.

I have arrayList of my classes and I use foreach function to instantiate this button and set it as child to my content panel.

Question. how do I need to calculate offsets, in order to place it as list inside my panel?

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
0
Best Answer

Answer by Kiwasi · Nov 04, 2014 at 06:39 AM

Since you are using the new UI you can just use the layout components. There is a vertical layout group and a layout element that will do the job.

I happen to have a video tutorial here that uses the layout components on a dropdown menu. But the components are reasonably easy to figure out.

Comment
Add comment · Show 8 · 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 SuperMasterBlasterLaser · Nov 04, 2014 at 07:00 AM 0
Share

I have added VerticalLayout component to my Contents panel. Instanciated all my prototypes and made them child of my contents panel. Problem is that heights of children are very small and I can barely see its contents.

avatar image Kiwasi · Nov 04, 2014 at 07:02 AM 0
Share

You need to add a layout element to each child. Set the $$anonymous$$imum height to whatever you like.

avatar image SuperMasterBlasterLaser · Nov 04, 2014 at 11:38 AM 0
Share

But how I can make my prototypes proprely scaled. It does not look like prototype, it looks like it was zoomed in. In editor mode with prototype Playe mode dynamically added through code

avatar image SuperMasterBlasterLaser · Nov 05, 2014 at 02:11 AM 0
Share

I want it look exactly like my prototype. I made preffered width and height. However it zooms my prototypes like that.

avatar image Kiwasi · Nov 05, 2014 at 02:43 AM 0
Share

Set the flexible height and width on the layout element to zero

Show more comments

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

27 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

Related Questions

A node in a childnode? 1 Answer

UI Tooltips and list with mask (tooltips semi visible) 0 Answers

How would you mask a UI canvas like you would mask a sprite? 1 Answer

UI Mask Not Working in Standalone Build (OSX) 0 Answers

Create big city for car game? 2 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