private void InitializeUI() { iBox background = new iBox(); background.size = windowRect.size - new Vector2(16, 16); background.RelativePosition(iRelativePosition.CENTER_Y_OF, windowRect); background.RelativePosition(iRelativePosition.CENTER_X_OF, windowRect); iScrollView scrollView = new iScrollView(); scrollView.size = background.size - new Vector2(16, 16); scrollView.padding = new iPadding(0, 0, 0, 0, 4f); scrollView.autoSizeMode = iScrollViewAutoSize.HORIZONTAL; scrollView.RelativePosition(iRelativePosition.CENTER_X_OF, background); scrollView.RelativePosition(iRelativePosition.CENTER_Y_OF, background); DrawSceneItem(scrollView); RegisterGUI(background, scrollView); }
private void Update() { button.size = this.size; button.size.x -= 48; button.position = this.position + new Vector2(16 + 8, 0); icon.position = this.position + new Vector2(2, 0); icon.RelativePosition(iRelativePosition.CENTER_Y_OF, button); label.SetText(this.text); label.RelativePosition(iRelativePosition.CENTER_Y_OF, button); label.RelativePosition(iRelativePosition.LEFT_IN, button); label.position.y -= 0.1f; }