Hello Guest

Author Topic: Trying to recalculate ScrollableArea content length from script.  (Read 4011 times)

ToffelskaterQ

  • Newbie
  • *
  • Posts: 2
    • View Profile
Trying to recalculate ScrollableArea content length from script.
« on: November 29, 2013, 01:10:24 pm »
Hey. Maybe I'm misunderstanding how to use scripts for tk2d, but I'm trying to recalculate content length of a horizontal scrollable area from an active game.

Could anyone basically write a little script example of how I'd do that? As i can't seem to make it work.

ToffelskaterQ

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Trying to recalculate ScrollableArea content length from script.
« Reply #1 on: November 29, 2013, 02:26:17 pm »
Solved it. In case anyone else is wondering i did it by adding this method into the ScrollableArea script:

   public void calculatecontentLength () {
   contentLength = MeasureContentLength ();   

   }

And then just called the method whenever i wanted to recalculate.