/// <summary> /// /// </summary> protected override void DoInitialize() { var label = new CtrlLabel(100, GUIAnchorStyles.None); //label.RenderBackground = true; // for debug purpose. label.Initialize(); label.AcceptPicking = false; this.label = label; this.Children.Add(label); label.TextChanged += label_TextChanged; label.Text = "Button"; }
/// <summary> /// /// </summary> protected override void DoInitialize() { this.RenderUnit.Initialize(); var label = new CtrlLabel(100, GUIAnchorStyles.None); label.Text = "Button"; label.TextChanged += label_TextChanged; // move label to center. { int diffX = this.Width - label.Width; int diffY = this.Height - label.Height; label.Location = new GUIPoint(diffX / 2, diffY / 2); } label.Initialize(); this.label = label; this.Children.Add(label); }