View Single Post
Old 12-11-2008, 02:33 PM   #20
JChan
A Gray Wolf
 
Join Date: Jul 2008
Posts: 8
Post

Quote:
Originally Posted by Tindos
What does secondary spacing do?


When using a TileLayoutBox, secondary spacing controls the gaps between the "wrapping row / column". For instance, you have spacing set to 5 and secondary spacing set to 10. You also have AnchorToTop and AnchorToLeft set to true. We'll also set HorizontalFirst to true. Here's a code example of that.

Code:
<TileLayoutBox item="BW_Buttons"> <RelativePosition>true</RelativePosition> <AutoStretch>true</AutoStretch> <BottomAnchorToTop>false</BottomAnchorToTop> <RightAnchorToLeft>false</RightAnchorToLeft> <Style_Transparent>true</Style_Transparent> <Spacing>5</Spacing> <SecondarySpacing>10</SecondarySpacing> <HorizontalFirst>true</HorizontalFirst> <AnchorToTop>true</AnchorToTop> <AnchorToLeft>true</AnchorToLeft> <FirstPieceTemplate>true</FirstPieceTemplate> <Pieces>BW_Buff0_Button</Pieces> <Pieces>BW_Buff1_Button</Pieces> ... </TileLayoutBox>


What do these things mean?

Spacing - controls the space between elements in the primary direction
Secondary Spacing - controls the space between elements in the secondary direction
AnchorToTop and AnchorToLeft - controls the corner that the layout will start from
HorizontalFirst - controls if elements will start laying out horizontally or vertically as the primary axis for direction

Back to the original example, AnchorToTop and AnchorToLeft are both true. This means that we will be starting in the top left corner for the first element. With HorizontalFirst set to true, any additional pieces are going to be put on the right of the previous piece with a gap of 5px (5 from Spacing). When the pieces reach the width of the box, they will then "wrap" to the next row with a 10px (10 from SecondarySpacing) gap between the rows.
__________________
J. Chan
Lead Programmer | EverQuest | Sony Online Entertainment
JChan is offline   Reply With Quote