Author Topic: Weird appearance of progress bar  (Read 3009 times)

4everlove

  • Guest
Weird appearance of progress bar
« on: May 27, 2012, 11:08:38 AM »
Hi,

I've created several progress bar in my game. However, I've noticed that all of them had really strange appearance. To be concrete, the "progress" texture is not as linear as to percentage (it seems a little bit exponential to me). For instance, if I set the slideValue to 50 percent, the "progress" should be in the middle. But in my game, it is in a position which normally should be of value 40 percent, which means the area of foreground is not equal to the area of background. When the slideValue has aa really low percentage (like < 10), when I increased progress by 1, I can hardly see the "progress" changing. How's that happen?

Thanks,
Alan

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Weird appearance of progress bar
« Reply #1 on: May 27, 2012, 12:44:50 PM »
I'm not sure what you did there. Try creating a new slider using the widget tool.

loopyllama

  • Guest
Re: Weird appearance of progress bar
« Reply #2 on: May 27, 2012, 01:45:46 PM »
I had this problem before. For me it was because the slider bar was a UISprite instead of a UISliced Sprite. to make it a slice sprite I selected the atlas and viewed the sprite in the inspector. Then I added a border by changing the border value. I deleted my broken slider and created it again. It was now a UISliced sprite and the slider worked fine. This was not obvious to me at the time.

4everlove

  • Guest
Re: Weird appearance of progress bar
« Reply #3 on: May 27, 2012, 08:57:52 PM »
I'm not sure what you did there. Try creating a new slider using the widget tool.

I do create my slider using widget tool. The "step" property is 0, but those values which is less than 0.1 (i.e. 0.1, 0.2...) will not affected the appearance of progress bar. Those values which is larger than 0.1 could have the correct movement. In addition, 0.55 will have each part equal to me. Here is an example: http://t2.qpic.cn/mblogpic/9682ae9914cbd86cc9c4/2000.jpg

UPDATE: Well I think I might understand what's going on. Through a slider, I noticed when sliderValue is equal to 0.5, the rightmost side of thumb, rather than foreground of a progress bar, is in the middle. The rightmost side of foreground of a progress bar is in the position with value less than 0.5. This also explains why when sliderValue is less than 0.1, I can't have progress bar move. It is because after 0.1, the thumb will has a distance from beginning, therefore we can have a progress bar move. I don't think this is wise to combine progress bar and slider bar. Or else maybe you should make the rightmost side of a progress bar be at the same position as that of a thumb

I had this problem before. For me it was because the slider bar was a UISprite instead of a UISliced Sprite. to make it a slice sprite I selected the atlas and viewed the sprite in the inspector. Then I added a border by changing the border value. I deleted my broken slider and created it again. It was now a UISliced sprite and the slider worked fine. This was not obvious to me at the time.

Thanks dude. But I do have a slice sprite in my progress bar :(
« Last Edit: May 28, 2012, 12:05:16 AM by 4everlove »