Making the progress bar smooth
JagonApps
Member Posts: 241
Hi there!
I have made a progress bar for my game following the code exactly as it is in this example:
However I can't see how to make the movement of it into a smooth motion (ie. an interpolate look)
I tried to use interpolate without luck, I think because it needs constraining (as it only worked to begin with).
Any help would be much appreciated
Cheers
Max
I have made a progress bar for my game following the code exactly as it is in this example:
However I can't see how to make the movement of it into a smooth motion (ie. an interpolate look)
I tried to use interpolate without luck, I think because it needs constraining (as it only worked to begin with).
Any help would be much appreciated
Cheers
Max
Best Answers
-
ericzingeler Posts: 334@JagonApps
I just threw this together for ya... This method is pretty simple and requires very little management. No rules, timers, interpolate... none of that. Just update the percentage attribute and it'll do the rest.
Read the instructions inside the project for details.
Replicated Progress Bar download -
The_Gamesalad_Guru Posts: 9,922@jargonApps it math you need the right divisor. If your point score is open ended as in the total points possible doesn't cap out that impossible to scale but if there is a cap the you work from that backwards. It doesn't matter how big the number. You could always use a % so if you have a total of 100,000 points you convert that into a percent and then use that % to scale you menu bar. So if I had accumulated 10% of the 100,000 and my bar was 1000 pixels long I would take 100 pixels off.
Answers
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
I am not sure that example will help because I'm pretty sure it is using the same code for the ink bar, it just looks smooth because the changes are very minute on the scale.
With my game the changes are quite big on the scale and without making a really small bar, I don't think I could make it work that way.
Thanks anyway
Max
Have you tried the Replicate behavior? Don't base it off of score, maybe instead base it off of a large number for total progress to completion. Have the bars actors be 1 px wide and have the progress integer interpolate as they progress which will slowly expand the bar. Not sure if that made much sense or if you get where I am going with it. Also, not sure what kind of performance issue something like that could have.
Thanks for the time you have given to make that, it is much appreciated. Although I have tried to understand it I am having trouble working out how I can use the template to change a score which its increments are quite large.
@FallacyStudios Thanks for the reply as well, I think what you were getting at was the same as ericzingeler.
Cheers
Max
@ericzingeler
Ok thanks guys, I have used your technique and it works great, and thanks for clearing that up Bacon!
To anyone else interested, although I did not use it in the end, I did find that if you store the last width of the progress bar in a self attribute, when the width changes you can use basic logic to interpolate the new width with the old, stored self attribute, then save the new width to the self attribute.
Cheers
Max