Author Topic: Calculate actual progress bar's foreground width  (Read 4164 times)

Markov

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 27
    • View Profile
Calculate actual progress bar's foreground width
« on: August 03, 2014, 02:00:51 AM »
Hello.
I'm trying to calculate width of progress bar foreground with NGUIMath.CalculateRelativeWidgetBounds, but it returns original size of this texture. So how to calculate actual size?
UPD: this foreground is a sliced texture so i can't just multiply original size of texture by progressBar.value.
« Last Edit: August 03, 2014, 08:31:06 AM by Markov »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Calculate actual progress bar's foreground width
« Reply #1 on: August 03, 2014, 09:55:52 AM »
UIWidget.drawingDimensions is what determines the actual dimensions clipped by the Draw Region setting. Alternatively you have to take UIWidget.drawRegion into consideration yourself.

Markov

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 27
    • View Profile
Re: Calculate actual progress bar's foreground width
« Reply #2 on: August 03, 2014, 02:21:23 PM »
Thanks!