public static UIScrollableVerticalLayout createScrollableLayout(UIToolkit toolkit, Vector2 size) { UIScrollableVerticalLayout layout = new UIScrollableVerticalLayout(0); layout.alignMode = UIAbstractContainer.UIContainerAlignMode.Left; layout.positionFromBottom(0); // Position it at the bottom of the screen to keep it out of the view. layout.edgeInsets = new UIEdgeInsets(0, 0, 0, 10); layout.setSize(size.x, size.y); // Create the scrollbar UIVerticalPanel scrollbar = UIVerticalPanel.create(toolkit, "scrollbar_top.png", "scrollbar_mid.png", "scrollbar_bottom.png"); int spacerSize = 16; hd(ref spacerSize); UISpacer spacer = new UISpacer(spacerSize, spacerSize); scrollbar.addChild(spacer); layout.addScrollBar(scrollbar, spacer); return(layout); }
public static UIScrollableVerticalLayout createScrollableLayout( UIToolkit toolkit, Vector2 size ) { UIScrollableVerticalLayout layout = new UIScrollableVerticalLayout(0); layout.alignMode = UIAbstractContainer.UIContainerAlignMode.Left; layout.positionFromBottom( 0 ); // Position it at the bottom of the screen to keep it out of the view. layout.edgeInsets = new UIEdgeInsets( 0, 0, 0, 10 ); layout.setSize( size.x, size.y ); // Create the scrollbar UIVerticalPanel scrollbar = UIVerticalPanel.create( toolkit, "scrollbar_top.png", "scrollbar_mid.png", "scrollbar_bottom.png" ); int spacerSize = 16; hd( ref spacerSize ); UISpacer spacer = new UISpacer( spacerSize, spacerSize ); scrollbar.addChild( spacer ); layout.addScrollBar( scrollbar, spacer ); return layout; }