Author Topic: UIProgress bar position at x value  (Read 2871 times)

yo_milo

  • Newbie
  • *
  • Thank You
  • -Given: 10
  • -Receive: 2
  • Posts: 36
    • View Profile
UIProgress bar position at x value
« on: April 27, 2017, 12:50:07 PM »
Greetings.

I was wondering if is there any convenience method to get either the local position or the world position of where a UIFillbar would be at t value.

This is because in my game I set a minimum percentage to win, and I want to get it on start, move the sprite that marks that percent, to whatever value it would be on my fillbar.

Because, I could hack it by having the sprite childed to the thumb, setting the value to t, unchilding the line at that position, then moving the value back to 0, but I think that is not the right way to do it.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIProgress bar position at x value
« Reply #1 on: April 28, 2017, 10:07:24 AM »
To get the position... assuming by "position" you mean the right side of the scroll bar set to go from left to right is progress bar's width * value, isn't it? I'm not entirely sure what you mean here. More advanced approach would be to consider progress bar's foreground widget's drawingDimensions.

yo_milo

  • Newbie
  • *
  • Thank You
  • -Given: 10
  • -Receive: 2
  • Posts: 36
    • View Profile
Re: UIProgress bar position at x value
« Reply #2 on: May 08, 2017, 12:53:59 PM »
This is what I mean.

I have a fillbar.
The thumb represents how many entities you have killed. Every level has a "marker" that indicates how many entities you must kill before you can pass the level.

The amount is usually 75%, but I wanted to know how to set my marker at whatever percentage of the fillbar.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIProgress bar position at x value
« Reply #3 on: May 13, 2017, 12:04:31 PM »
Yup, so my previous answer stands. I'd recommend using the drawingDimensions.

yo_milo

  • Newbie
  • *
  • Thank You
  • -Given: 10
  • -Receive: 2
  • Posts: 36
    • View Profile
Re: UIProgress bar position at x value
« Reply #4 on: May 17, 2017, 04:35:27 PM »
Thank you, that was all I needed to know.