Author Topic: What controls the size of the foreground in UIScrollbar  (Read 2570 times)

coolaneasy

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 34
    • View Profile
What controls the size of the foreground in UIScrollbar
« on: July 17, 2014, 04:18:22 PM »
Hi guys
As I mentioned in the subject I'm trying to figure out what controls the size of the foreground sprite in a scrollbar.
I know its from the size variable but its not resizing the sprite. The sprite remains the same size but it fills varying portions of the sprite. How is this being done?
Thanks

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: What controls the size of the foreground in UIScrollbar
« Reply #1 on: July 18, 2014, 05:11:42 AM »
It's done by modifying the UIWidget's drawRegion.
  1.         /// <summary>
  2.         /// Draw region alters how the widget looks without modifying the widget's rectangle.
  3.         /// A region is made up of 4 relative values (0-1 range). The order is Left (X), Bottom (Y), Right (Z) and Top (W).
  4.         /// To have a widget's left edge be 30% from the left side, set X to 0.3. To have the widget's right edge be 30%
  5.         /// from the right hand side, set Z to 0.7.
  6.         /// </summary>
  7.  
  8.         public Vector4 drawRegion