Beispiel #1
0
        private void OnOptionClick(object sender, EventArgs e)
        {
            var option = (SelectOptionGuiElement <TValue>)sender;

            SelectedOption = option;
            OptionsLayout.MoveToFront(SelectedOption);
        }
Beispiel #2
0
 public SelectGuiElement(Texture2D background, Rectangle rectangle, SelectOptionGuiElement <TValue> defaultElement,
                         params SelectOptionGuiElement <TValue>[] options) : base(rectangle)
 {
     OptionsLayout = new VerticalLayout(background, rectangle, true);
     if (options != null)
     {
         foreach (var opt in options)
         {
             opt.OnClick += OnOptionClick;
             OptionsLayout.AddChild(opt);
         }
     }
     SelectedOption          = defaultElement;
     OptionsLayout.IsVisible = false;
     AddChild(OptionsLayout);
 }