16
NGUI 3 Support / UISlider how to get positions along the background sprite?
« on: May 13, 2014, 06:51:12 AM »
Hi,
I have a slider component and I would like to create a rectangle sprite on top of the slider's background image. I want this sprite to cover a certain area of the slider, let's say from 50% to 70%. How to I get the positioning and sizing to do that?
I know that the thumb image when positioned at those percentages will give me that position but how can that be calculated with code? I tried to get the slider's background widget width but the value is somehow much longer that on screen. How can I get the total width of my slider?
Thanks
I have a slider component and I would like to create a rectangle sprite on top of the slider's background image. I want this sprite to cover a certain area of the slider, let's say from 50% to 70%. How to I get the positioning and sizing to do that?
I know that the thumb image when positioned at those percentages will give me that position but how can that be calculated with code? I tried to get the slider's background widget width but the value is somehow much longer that on screen. How can I get the total width of my slider?
Thanks
