Hello Guest

Author Topic: UIScrollableArea content length with UILayoutContainerSizer  (Read 4212 times)

nykomic

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
UIScrollableArea content length with UILayoutContainerSizer
« on: March 20, 2014, 01:55:44 pm »
I have a tk2dUIScrollableArea with content layout container that contains 3 UI Layout (fixed size - ex: 200px)

[Editor mode]
When i click on "Calculate content length", I have the "GetRendererBoundsInChildren" length = ex: 500px because my last sprite on the third UILayout do not stick to right side (there is 100px of "empty space").

It is not correct for me, I expect the length of all UILayout (+margin)
So : 3x200px = 600px
In [Play Mode] if I regenerate the tk2dUILayoutContainerSizer, it changes my tk2dUIScrollableArea 's content length to 600px.
This is correct.

In other words, I think there is 2 modes :
- manual UIScrollable Area => must return GetRendererBoundsInChildren
- UILayout based UIScrollable Area => must return UILayout container sizer length (regardless sprite renderer) (If I choose to have 10*200px  UILayouts empty, I expect 2000px as length)

As a workaround I set content length manually with play mode value.
What do you think ? Is it normal or not ? There is another way ?

And some features ideas :
- get/set an explicit size for a tk2dUILayout (currently we can move the bounds but we do not know exactly the size)
- like InterfaceBuilder, can choose if the sprite must be scaled/stretch (x/y) or not (centered) (UILayout Edit Mode)
(see attached file : http://www.techotopia.com/images/0/04/Iphone_autosize_margins_set.jpg)

Thanks!

ps: sorry for my english ;)

----------- EDIT
Erf, I just see that I have correct values if i regenerate UILayout container sizer in Editor mode too.
So I must be careful to not click on "Calculate content length" ^^
« Last Edit: March 20, 2014, 02:07:38 pm by nykomic »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: UIScrollableArea content length with UILayoutContainerSizer
« Reply #1 on: March 20, 2014, 02:16:25 pm »
If you're using layout sizers don't click that button! It will likely screw things up. I'll add some code to block that.