コード例 #1
0
ファイル: Pawn.cs プロジェクト: schwarzeszeux/CraftworkGUI
 public Pawn(ITextureRegion textureRegion, int row, int column, int direction)
     : base(CreateControl(textureRegion), row, column)
 {
     Direction = direction;
     var button = Control as Button;
     button.Clicked += HandleClicked;
 }
コード例 #2
0
        public Pawn(ITextureRegion textureRegion, int row, int column, int direction)
            : base(CreateControl(textureRegion), row, column)
        {
            Direction = direction;
            var button = Control as Button;

            button.Clicked += HandleClicked;
        }
コード例 #3
0
 public VisualStyle(ITextureRegion textureRegion)
 {
     TextureRegion  = textureRegion;
     Colour = Color.White;
     Rotation = 0;
     Origin = Vector2.Zero;
     Scale = Vector2.One;
     Effect = SpriteEffects.None;
     Depth = 0;
 }
コード例 #4
0
 public VisualStyle(ITextureRegion textureRegion)
 {
     TextureRegion = textureRegion;
     Colour        = Color.White;
     Rotation      = 0;
     Origin        = Vector2.Zero;
     Scale         = Vector2.One;
     Effect        = SpriteEffects.None;
     Depth         = 0;
 }
コード例 #5
0
ファイル: Pawn.cs プロジェクト: schwarzeszeux/CraftworkGUI
        private static Control CreateControl(ITextureRegion textureRegion)
        {
            var normalStyle = new VisualStyle(textureRegion)
            {
                Colour = Color.LightGray
            };

            var button = new Button(normalStyle)
            {
                HoverStyle = new VisualStyle(textureRegion) { Colour = Color.White },
                Width = 64,
                Height = 64
            };
            return button;
        }
コード例 #6
0
        private Button CreateButton(ITextureRegion textureRegion)
        {
            var button = new Button(new VisualStyle(textureRegion))
            {
                NormalStyle = new VisualStyle(textureRegion),
                HoverStyle  = new VisualStyle(textureRegion)
                {
                    Scale = new Vector2(1.05f, 1.05f),
                },
                PressedStyle = new VisualStyle(textureRegion)
                {
                    Scale = new Vector2(0.95f, 0.95f),
                }
            };

            return(button);
        }
コード例 #7
0
ファイル: GUIDemo.cs プロジェクト: netonjm/Rube.Net
		private Button CreateButton(ITextureRegion textureRegion)
		{
			var button = new Button(new VisualStyle(textureRegion)) 
			{ 
				NormalStyle = new VisualStyle(textureRegion),
				HoverStyle = new VisualStyle(textureRegion) 
				{ 
					Scale = new Vector2(1.05f, 1.05f),
				},
				PressedStyle = new VisualStyle(textureRegion)
				{
					Scale = new Vector2(0.95f, 0.95f),
				}
			};
            _game.StarTestRube();
            
			button.Clicked+= HandleClicked;
			return button;
		}
コード例 #8
0
        private static Control CreateControl(ITextureRegion textureRegion)
        {
            var normalStyle = new VisualStyle(textureRegion)
            {
                Colour = Color.LightGray
            };

            var button = new Button(normalStyle)
            {
                HoverStyle = new VisualStyle(textureRegion)
                {
                    Colour = Color.White
                },
                Width  = 64,
                Height = 64
            };

            return(button);
        }
コード例 #9
0
        private Button CreateButton(ITextureRegion textureRegion)
        {
            var button = new Button(new VisualStyle(textureRegion))
            {
                NormalStyle = new VisualStyle(textureRegion),
                HoverStyle  = new VisualStyle(textureRegion)
                {
                    Scale = new Vector2(1.05f, 1.05f),
                },
                PressedStyle = new VisualStyle(textureRegion)
                {
                    Scale = new Vector2(0.95f, 0.95f),
                }
            };

            _game.StarTestRube();

            button.Clicked += HandleClicked;
            return(button);
        }
コード例 #10
0
 public void Draw(ITextureRegion textureRegion, IRectangle destinationRectangle)
 {
     // TODO: Remove this slight hack
     Draw(new VisualStyle(textureRegion), destinationRectangle);
 }
コード例 #11
0
ファイル: Game1.cs プロジェクト: pakoito/CraftworkGames
 private Button CreateTiltingButton(ITextureRegion textureRegion, float rotation)
 {
     return new Button(new VisualStyle(textureRegion))
     {
         HoverStyle = new VisualStyle(textureRegion)
         {
             Rotation = rotation,
             Origin = new Vector2(0.5f, 0.5f)
         },
     };
 }
コード例 #12
0
ファイル: Game1.cs プロジェクト: pakoito/CraftworkGames
 private Button CreateScalingButton(ITextureRegion textureRegion)
 {
     return new Button(new VisualStyle(textureRegion))
     {
         HoverStyle = new VisualStyle(textureRegion) { Scale = new Vector2(1.05f) },
         PressedStyle = new VisualStyle(textureRegion) { Scale = new Vector2(0.95f) },
     };
 }
コード例 #13
0
 public void Draw(ITextureRegion textureRegion, IRectangle destinationRectangle)
 {
     // TODO: Remove this slight hack
     Draw(new VisualStyle(textureRegion), destinationRectangle);
 }
コード例 #14
0
        private Button CreateButton(ITextureRegion textureRegion)
        {
            var button = new Button(new VisualStyle(textureRegion))
            {
                NormalStyle = new VisualStyle(textureRegion),
                HoverStyle = new VisualStyle(textureRegion)
                {
                    Scale = new Vector2(1.05f, 1.05f),
                },
                PressedStyle = new VisualStyle(textureRegion)
                {
                    Scale = new Vector2(0.95f, 0.95f),
                }
            };

            return button;
        }