Example #1
0
 protected ButtonBase(ButtonFrames frames, string iconName, Action onUp)
     : this(frames,
     SkidiGame.ResourceManager.GetFrame(iconName))
 {
     if (onUp != null)
         this.AddEventListener(PointerEvent.PointerEventType.Up, onUp);
 }
Example #2
0
 public Button(ButtonFrames frames)
     : this()
 {
     _defaultFrame = frames.Default;
     _hoverFrame = frames.Hover;
     _downFrame = frames.Down;
     PointerState = PointerState.Default;
 }
Example #3
0
 public TextButton(ButtonFrames frames, SpriteFont font, int textSize, string text)
     : base(frames)
 {
     _text = new TextNode(font, textSize)
     {
         Text = text
     };
     Icon = _text;
 }
Example #4
0
            protected ButtonBase(ButtonFrames frames, TextureFrame icon)
                : base(frames, icon)
            {
                var iconOrigin = new Vector2(0, 4) * SkidiBirdGame.Scale;
                OriginState = new[] { -iconOrigin, -iconOrigin, iconOrigin };

                this.AddSignalHandler(CommonSignals.Ui.Enable, () => Enabled = true);
                this.AddSignalHandler(CommonSignals.Ui.Disable, () => Enabled = false);
            }
Example #5
0
 public IconButton(ButtonFrames frames, TextureFrame icon = null)
     : base(frames)
 {
     _icon = new Sprite
     {
         Frame = icon
     };
     Icon = _icon;
 }
Example #6
0
 public TextButton(ButtonFrames frames, SpriteFont font, int textSize)
     : this(frames, font, textSize, String.Empty)
 {
 }
Example #7
0
 protected ExtButton(ButtonFrames frames)
     : base(frames)
 {
 }