コード例 #1
0
ファイル: UIBuilder.cs プロジェクト: pilotMike/TMPE
 /// <summary>Quick create a label and stack it. Optionally set markup processing mode.</summary>
 /// <param name="t">Localized text.</param>
 /// <param name="stack">Stacking mode related to previous sibling.</param>
 /// <param name="processMarkup">Whether label text contains C:S color markup.</param>
 /// <returns>New label.</returns>
 public U.ULabel Label(string t, UStackMode stack, bool processMarkup = false)
 {
     using (UiBuilder <ULabel> labelB = this.Label <U.ULabel>(t)) {
         labelB.ResizeFunction(r => r.Stack(mode: stack));
         labelB.Control.processMarkup = processMarkup;
         return(labelB.Control);
     }
 }
コード例 #2
0
ファイル: UIBuilder.cs プロジェクト: pilotMike/TMPE
        public UiBuilder <TButton> FixedSizeButton <TButton>(string text,
                                                             string tooltip,
                                                             Vector2 size,
                                                             UStackMode stack)
            where TButton : UIButton, ISmartSizableControl
        {
            UiBuilder <TButton> builder = this.Button <TButton>();

            builder.Control.text    = text;
            builder.Control.tooltip = tooltip;
            builder.SetStacking(stack);
            builder.SetFixedSize(size);
            return(builder);
        }