Exemple #1
0
        public static void HStack(String title = null, int stride = 0, params Action[] actions)
        {
            var length = actions.Length;

            if (stride < 1)
            {
                stride = length;
            }
            if (Main.IsNarrow)
            {
                stride = Math.Min(3, stride);
            }
            for (int ii = 0; ii < actions.Length; ii += stride)
            {
                bool hasTitle = title != null;
                UI.BeginHorizontal();
                if (hasTitle)
                {
                    if (ii == 0)
                    {
                        UI.Label(title.bold(), UI.Width(150f));
                    }
                    else
                    {
                        UI.Space(153);
                    }
                }
                UI.Group(actions.Skip(ii).Take(stride).ToArray());
                UI.EndHorizontal();
            }
        }
Exemple #2
0
 public static void VStack(String title = null, params Action[] actions)
 {
     UI.BeginVertical();
     if (title != null)
     {
         UI.Label(title);
     }
     UI.Group(actions);
     UI.EndVertical();
 }