public MarketWindow() { Title = LanguageConfig.Config.Market; buyWindow = new Rectangle(0, 0, 400, 500); sellWindow = new Rectangle(0, 0, 400, 500); Width = buyWindow.Width + sellWindow.Width; Height = buyWindow.Height; CenterWindowPosition(); CenterInnerWindows(); BuyButton = new Button(LanguageConfig.Config.Buy); BuyButton.Font = Fonts.ArialBlack12; BuyButton.Width = 100; BuyButton.Height = (int) (Fonts.ArialBlack12.MeasureString(BuyButton.Text).Y + borderPadding.Y); BuyButton.Position = new Vector2( buyWindow.X + buyWindow.Width/2 - BuyButton.Width/2, buyWindow.Y + buyWindow.Height - (BuyButton.Height + borderPadding.Y)); SellButton = new Button(LanguageConfig.Config.Sell); SellButton.Font = Fonts.ArialBlack12; SellButton.Width = 100; SellButton.Height = (int) (Fonts.ArialBlack12.MeasureString(SellButton.Text).Y + borderPadding.Y); SellButton.Position = new Vector2( sellWindow.X + sellWindow.Width/2 - SellButton.Width/2, sellWindow.Y + sellWindow.Height - (SellButton.Height + borderPadding.Y)); }
public BackgroundConfigWindow(BackgroundCreationConfig config) { Title = "Config"; BackgroundColor = Color.White; Opacity = 255; borderPadding = new Vector2(15, 15); this.config = config; var btnChangeTitle = new Button("Title"); btnChangeTitle.Clicked += btnChangeTitle_Clicked; Components = new List<UIComponent>(); Components.Add(btnChangeTitle); var stacked = 0; foreach (var item in Components) { if (item is Button) { var btn = item as Button; btn.Position = new Vector2(stacked + btn.Width + 15, 15); stacked += btn.Width + 15; } } }
public DebugWindow(LotusGame Game) { Player = Game.Player; game = Game; Width = 560; Height = 600; Opacity = 255; BackgroundColor = Color.White; addLevel = new Button("Add Level"); addLevel.Clicked += addLevel_Clicked; btnSaveGame = new Button("Save Game"); btnSaveGame.Clicked += btnSaveGame_Clicked; Controls = new List<Button>(); Controls.Add(addLevel); Controls.Add(btnSaveGame); Position = new Vector2( GameConfig.Config.WindowWidth/2 - Width/2, GameConfig.Config.WindowHeight/2 - Height/2); }