Esempio n. 1
0
 private void AddDeleteButton()
 {
     DeleteButton                 = AddUIComponent <CustomUIButton>();
     DeleteButton.zOrder          = 0;
     DeleteButton.atlas           = CommonTextures.Atlas;
     DeleteButton.normalBgSprite  = CommonTextures.DeleteNormal;
     DeleteButton.hoveredBgSprite = CommonTextures.DeleteHover;
     DeleteButton.pressedBgSprite = CommonTextures.DeletePressed;
     DeleteButton.size            = new Vector2(20, 20);
     DeleteButton.eventClick     += DeleteClick;
 }
Esempio n. 2
0
        public HeaderButton()
        {
            atlas                   = CommonTextures.Atlas;
            hoveredBgSprite         = pressedBgSprite = focusedBgSprite = CommonTextures.HeaderHoverSprite;
            size                    = new Vector2(Size, Size);
            clipChildren            = true;
            textPadding             = new RectOffset(IconSize + 5, 5, 5, 0);
            textScale               = 0.8f;
            textHorizontalAlignment = UIHorizontalAlignment.Left;
            minimumSize             = size;

            Icon                  = AddUIComponent <CustomUIButton>();
            Icon.size             = new Vector2(IconSize, IconSize);
            Icon.relativePosition = new Vector2(IconPadding, IconPadding);
        }