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 derian7 · Sep 11, 2016 at 02:09 AM · loaduser interfacebarprogress bar

Best way to make an animated infinite striped progress bar?

Working on my first project (2d mobile game) and I've read other sources of making a progress bars but I haven't found to make a striped progress bar that is looping. Like this: alt text

but animated. I need 9 of these in my scene. So what's the best way to do it without being too resource intensive?

tz4cu.png (861 B)
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
1

Answer by JoshuaMcKenzie · Sep 11, 2016 at 10:11 AM

  • Import your Loading bar into the project, select the image in the project view and make the sprite mode multiple

  • Open the Sprite editor and make multiple slices of the bar. Each slice will all be the same width (roughly the width of a stripe), and each slice will serve as a frame for the loading bar's animation

  • next in the scene create Asset->UI->Slider and delete the "handle slide area" gameobject (you won't need it),

  • since you won't have a handle you'll want to clean up the sliders offsets. navigate to both the child "Fill Area" and "Fill" gameobjects and set their left and right values on the Rect Transform to 0 (so that the sliding bar will go flush with the background container)

  • on the "Fill" GameObject add the Mask Component and uncheck the show mask graphic

  • from the project view grab all the frames of the loading bar as a group and drag them into the scene (Unity should automatically turn the images into an animation and place them on a gameObject with a sprite renderer and animator... depending on which version of unity you are using)

  • parent this gameobject onto "Fill" and set its rect transform to stretch to match its parent. to do this click on the unique square decal in the Rect Transform component (a window should pop up) and in the popup window shift+alt+click the lower-right box with stretch arrows

  • Since Sprite Renderers don't work on a Canvas, you should remove that component and use Image Component instead. on the Image component set the Image type to tiled so that the loading bar image can repeat infinitely.

  • Go to Window->Animation to open up the animation panel. make sure you have your loading bar game object selected. currently the animation is storing keyframes for animating a Sprite Renderer property (which you should have deleted so it should mention that its missing) right click and delete this property.

  • finally, in this animation editor, add a new property for Image.sprite. Now, similar to how Sprite renderer had its keyframes set to animate the loading bar, you need to do the same by placing each frame of the loading bar into the animation window at the desired frame. when you are done make sure you close the animation window (the window loves to record ANYTHING that you do which can mess up your animations, so its best to close it the moment you finish)

  • Play the level. and mess with the value property on the Slider component on the parent object to see how the loading bar will move.

From there you should be able to continue and make out any tweaks and polish that you need

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

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Unity 5.0 Progress bar for scene loading JS 2 Answers

Progress Bar 2 Answers

"loading image or a bar" in between scene switching 2 Answers

Does Resources.Load not fail on purpose? 0 Answers

array is pointer and float variable is not - why not? C# 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