2D Toolkit Forum

2D Toolkit => Support => Topic started by: ToffelskaterQ on November 29, 2013, 01:10:24 pm

Title: Trying to recalculate ScrollableArea content length from script.
Post by: ToffelskaterQ 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.
Title: Re: Trying to recalculate ScrollableArea content length from script.
Post by: ToffelskaterQ 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.