PDA

View Full Version : Progress bar



Rob H
April 17th, 2005, 08:20 AM
I'm trying to use a progress bar to implement a star rating.

I have two images - each of which has 5 small stars equally spaced (grey and blue). The stars are each 14 pixels wide with the centre on the 7 pixel boundary. The whole image is 70 pixels wide.

The Progress bar is defined as follows :-

1,test,0,9

Which should split it into 7 pixel areas. As I increment the value of test the blue stars replace the grey ones. It appears to work fine for values of 1 and 2, but after that the scaling seems to be off a bit.

I've attached the zipped CCF to this message.

Ben S
April 17th, 2005, 09:42 AM
Hi Rob -
Agreed that it looks weird (so I've replicated it). I won't be able to turn around a fix today, as I'm trying to wrap up the next designer and MediaBridge, but I'll look into it this week.

Thanks!

Rob H
April 17th, 2005, 09:53 AM
Thanks Ben, at least it isn't something I've done wrong.

danward79
April 17th, 2005, 09:56 AM
I get the same fault here.

Ben S
April 18th, 2005, 07:29 AM
Hey! What are you trying to pull? This is rendering properly, it's the # to star conversion that's off. :)

Change the max value to 10 (instead of 9) and you're good to go.

If no stars are set, you're at 0, whereas 10 is all stars, not 9. 9 should only be 4.5 stars.

Star | Value
0.0 = 0
0.5 = 1
1.0 = 2
1.5 = 3
2.0 = 4
2.5 = 5
3.0 = 6
3.5 = 7
4.0 = 8
4.5 = 9
5.0 = 10

Unless you really want 9 to be the max, but then you should use 3 stars and have each value be a third of a star. :)

5 / 9 = 0.55 of a star, which is about how much it's moving now.

Rob H
April 18th, 2005, 07:34 AM
Oops! Sorry about that. :oops:

Ben S
April 18th, 2005, 07:43 AM
Not a problem, buddy. :)