public SaveScreen(Game game, SpriteBatch spriteBatch, SpriteFont spriteFont, ContentManager content) : base(game, spriteBatch) { this.spriteFont = spriteFont; this.spriteBatch = spriteBatch; this.content = content; bound = new Rectangle((game.Window.ClientBounds.Width - 300) / 2, (game.Window.ClientBounds.Height - 200) / 2, 300, 200); texture = new Texture2D(game.GraphicsDevice, 1, 1); texture.SetData(new[] { Color.Gray }); float x = game.Window.ClientBounds.Center.X, y = game.Window.ClientBounds.Center.Y; Point orientation = new Point(game.Window.ClientBounds.Width / 2, game.Window.ClientBounds.Height / 2); cancelButton = new UI_Button(game, spriteBatch, spriteFont, "Cancel", orientation, new Rectangle(-100, 40, 80, 20)); saveButton = new UI_Button(game, spriteBatch, spriteFont, "Save", orientation, new Rectangle(20 , 40 , 80, 20)); Texture2D t0 = content.Load<Texture2D>("textures/ui/unCheckedCheckBox"); Texture2D t1 = content.Load<Texture2D>("textures/ui/CheckedCheckBox"); overwriteCheckbox = new UI_Checkbox(game, spriteBatch, spriteFont, new Vector2(t1.Width, t1.Height), t0, t1); textBox = new TextBox(game, spriteBatch, spriteFont, new Rectangle((game.Window.ClientBounds.Width - 250) / 2, game.Window.ClientBounds.Height / 2 -50, 250, 30)); Components.Add(textBox); }
public LoadScreen(Game game, SpriteBatch spriteBatch, SpriteFont spriteFont) : base(game, spriteBatch) { this.spriteFont = spriteFont; this.spriteBatch = spriteBatch; uiSelectBox = new UI_SelectBox(game, spriteBatch, spriteFont, Vector2.Zero); cancelButton = new UI_Button(game, spriteBatch, spriteFont, "Cancel", new Point(game.Window.ClientBounds.Width / 2 - 100, game.Window.ClientBounds.Height/ 2 - 15), new Rectangle(0, 220, 200, 30)); }