Пример #1
0
 public UIButton(string label, Rectangle frame, UIButtonStyleSet styles, OnPressDelegate onPress)
 {
     this.label = label;
     this.frame = frame;
     this.styles = styles;
     this.onPress = onPress;
 }
Пример #2
0
        public MagicUI(Player viewingPlayer, ContentManager content, GraphicsDevice device)
        {
            this.viewingPlayer = viewingPlayer;

            font = content.Load<SpriteFont>("Font");

            Texture2D normalButtonTexture = Texture2D.FromStream(device, File.OpenRead("Content/button3d.png"));
            Texture2D hoverButtonTexture = Texture2D.FromStream(device, File.OpenRead("Content/button3d_hover.png"));
            Texture2D pressButtonTexture = Texture2D.FromStream(device, File.OpenRead("Content/button3d_pressed.png"));

            cardBack = Texture2D.FromStream(device, File.OpenRead("Content/card-back.jpg"));
            symbolsTexture = Texture2D.FromStream(device, File.OpenRead("Content/mtgsymbols.png"));

            basicButtonStyle = new UIButtonStyleSet(
                new UIButtonStyle(font, Color.Black, normalButtonTexture, Color.White),
                new UIButtonStyle(font, Color.Yellow, hoverButtonTexture, Color.White),
                new UIButtonStyle(font, Color.Yellow, pressButtonTexture, Color.White, new Vector2(0,1))
            );

            buttons = new List<UIButton>() { new UIButton("Continue", new Rectangle(690, 420, 100, 50), basicButtonStyle, OnPressContinue) };
        }