Exemplo n.º 1
0
        /// <summary>
        /// Create button with text on table
        /// </summary>
        /// <param name="t">TargetTable</param>
        /// <param name="label">Text</param>
        /// <param name="onClick">On button click event handler</param>
        /// <returns>Element</returns>
        public TextButton CreateBtn(Table t, string label, Action <TextButton> onClick)
        {
            var button = new TextButton(label, _skin.Skin.Get <TextButtonStyle>("regular-button"));

            button.GetLabel().SetStyle(_skin.Skin.Get <LabelStyle>("label"));
            button.GetLabel().SetAlignment(Align.Left);
            button.OnClicked += btn =>
            {
                onClick(button);
            };
            t.Add(button).SetMinWidth(450).SetMinHeight(100).SetAlign(Align.Left);

            return(button);
        }