Exemplo n.º 1
0
 public Slider(Vector2 pos, Vector2 size, HAlign hAlign, VAlign vAlign, string ID)
     : base(pos, size, hAlign, vAlign, true, ContentType.Structural, "")
 {
     this.ID = ID;
     InnerElements.Add(new UIObject(Vector2.Zero, size - new Vector2(Style.SliderHandleSize.X, 0), HAlign.Center, VAlign.Center, false, ContentType.Image, Style.SliderBar));
     InnerElements.Add(new UIObject(Vector2.Zero, Style.SliderHandleSize, HAlign.Center, VAlign.Center, false, ContentType.Image, Style.SliderHandle));
     Init();
 }
Exemplo n.º 2
0
 public override void Init()
 {
     for (int i = 0; i < Player.Instance.Abilities.Count; i++)
     {
         InnerElements.Add(new AbilityButton(new Vector2(BAR_PADDING + (ICON_WIDTH + BUTTON_PADDING * 2) * i, 0), new Vector2(ICON_WIDTH + BUTTON_PADDING * 2, ICON_HEIGHT + BUTTON_PADDING * 2), HAlign.Left, VAlign.Center, Player.Instance.Abilities[i].type));
     }
     base.Init();
 }
Exemplo n.º 3
0
 public AbilityButton(Vector2 pos, Vector2 size, HAlign hAlign, VAlign vAlign, AbilityType abilityType)
     : base(pos, size, hAlign, vAlign, "", REGULAR_TEX, MOUSEOVER_TEX, PRESSED_TEX)
 {
     m_abilityType = abilityType;
     InnerElements.Add(new UIObject(Vector2.Zero, new Vector2(AbilityBar.ICON_WIDTH, AbilityBar.ICON_HEIGHT), HAlign.Center, VAlign.Center, false, ContentType.Image, Player.Instance.GetAbilityByType(m_abilityType).m_iconTextureAssetName,
                                    new List <UIObject> {
         new Label(Vector2.Zero, HAlign.Right, VAlign.Bottom, Player.Instance.GetAbilityByType(abilityType).Cost.ToString())
     }));
 }
Exemplo n.º 4
0
 public Switcher(Vector2 pos, Vector2 size, HAlign hAlign, VAlign vAlign, string ID, List <string> options)
     : base(pos, size, hAlign, vAlign, true, ContentType.Structural, "")
 {
     this.options = options;
     this.ID      = ID;
     InnerElements.Add(new Button(Vector2.Zero, new Vector2(size.Y, size.Y), HAlign.Left, VAlign.Top, "SwitcherLeft", Style.SwitcherLeftNormal, Style.SwitcherLeftMouseOver, Style.SwitcherLeftPressed));
     InnerElements.Add(new Button(Vector2.Zero, new Vector2(size.Y, size.Y), HAlign.Right, VAlign.Top, "SwitcherRight", Style.SwitcherRightNormal, Style.SwitcherRightMouseOver, Style.SwitcherRightPressed));
     InnerElements.Add(new Label(Vector2.Zero, HAlign.Center, VAlign.Center, ""));
     Init();
     foreach (UIObject element in InnerElements)
     {
         element.parent = this;
     }
 }
Exemplo n.º 5
0
            /// <summary>
            /// Инициализировать рендерер.
            /// </summary>
            /// <returns>Графические данные.</returns>
            public override IEnumerable <ChartIndicatorElement> Init()
            {
                InnerElements.Clear();

                InnerElements.Add(_pnl = new ChartIndicatorElement
                {
                    YAxisId         = BaseElement.YAxisId,
                    DrawStyle       = ChartIndicatorDrawStyles.BandOneValue,
                    Color           = Colors.Green,
                    AdditionalColor = Colors.Red,
                    StrokeThickness = BaseElement.StrokeThickness,
                    Title           = "PnL"
                });

                return(InnerElements);
            }