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; }
public VisualStyle(ITextureRegion textureRegion) { TextureRegion = textureRegion; Colour = Color.White; Rotation = 0; Origin = Vector2.Zero; Scale = Vector2.One; Effect = SpriteEffects.None; Depth = 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; }
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); }
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; }
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); }
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); }
public void Draw(ITextureRegion textureRegion, IRectangle destinationRectangle) { // TODO: Remove this slight hack Draw(new VisualStyle(textureRegion), destinationRectangle); }
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) }, }; }
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) }, }; }
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; }