public void Add(GameButton g) { Buttons.Add(g); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); Main.testFont = base.Content.Load<SpriteFont>("Font" + Path.DirectorySeparatorChar + "Mouse_Text"); Main.cursorTexture = new Sprite((base.Content.Load<Texture2D>("Images" + Path.DirectorySeparatorChar + "Cursor")), default(Vector2), false); Main.blockTexture = new Sprite((base.Content.Load<Texture2D>(/*"Images" + Path.DirectorySeparatorChar + */@"CharBounds")), default(Vector2), true); Main.charBounds = new Sprite((base.Content.Load<Texture2D>(/*"Images" + Path.DirectorySeparatorChar + */@"CharBounds")), default(Vector2), true); //Main.ground = base.Content.Load<Texture2D>("Images" + Path.DirectorySeparatorChar + "Ground"); //createCollidableAlpha(ref testAlpha, "Images" + Path.DirectorySeparatorChar + "TransTest", new Vector2(650, 360)); createCollidableAlpha(ref ground, @"ObstacleCourse", new Vector2(-128, 616 + 64 - 1280)); //Main.background = new Sprite((base.Content.Load<Texture2D>("Images" + Path.DirectorySeparatorChar + "Background")), default(Vector2), false); Main.background = new Sprite((new Texture2D(graphics.GraphicsDevice, 1280, 720)), default(Vector2), true); Color[] backData = new Color[1280 * 720]; for (int i = 0; i < 1280 * 720; i++) backData[i] = Color.LightGray; Main.background.Texture.SetData<Color>(backData); Main.shopText = new Sprite((base.Content.Load<Texture2D>("Images" + Path.DirectorySeparatorChar + "Shopkeeper")), shopPos, true); Main.textBox = new Sprite((base.Content.Load<Texture2D>(@"Textbox")), default(Vector2), true); Main.startTexture = new Sprite((base.Content.Load<Texture2D>(@"StartImage")), default(Vector2), true); GameButton LoadDemo = new GameButton(new Vector2(10, 130), ">Load Demo", true, testFont); GameButton LevelOne = new GameButton(new Vector2(10, 150), ">Level One", true, testFont); GameButton StartLevelOne = new GameButton(new Vector2(10, 170), ">Save Edit", true, testFont); Collisions = new GameButton(new Vector2(10, 210), ">Test Destruction", true, testFont); GameButton stairButton = new GameButton(new Vector2(10, 230), ">Test Stairs", true, testFont); GameButton menuStart = new GameButton(new Vector2(640 - testFont.MeasureString("Start").X / 2, 360), "Start", true, testFont); Main.menuGround = new Sprite((new Texture2D(graphics.GraphicsDevice, 1280, 72)), default(Vector2), true); Color[] tData = new Color[1280 * 72]; for (int i = 0; i < 1280*72; i++) tData[i] = Color.Green; EditButton.Font = testFont; buttons.Add(LevelOne); buttons.Add(StartLevelOne); buttons.Add(EditButton); buttons.Add(Collisions); buttons.Add(LoadDemo); buttons.Add(stairButton); menuButtons.Add(menuStart); cBoxT = new Texture2D(graphics.GraphicsDevice, 32, 32); Color[] cBoxColor = new Color[32 * 32]; for (int i = 0; i < cBoxColor.Length; i++ ) cBoxColor[i] = new Color(180, 80, 80, 180); cBoxT.SetData(cBoxColor); for ( int i = 0; i < 20; i++) ContainerMenu.Add(textBox.Texture, new Vector2( (i % 5) * 56, ( i / 5 * 56))); ContainerMenu.Add("Container Test", new Vector2(0, -30)); ContainerMenu.Position = new Vector2( 640 - (5*28), 360 - (4*28)); TalkingMenu.Add(textBox.Texture, new Vector2(0, 0)); //Main.collidableSprites.Add(groundRect); //Main.collidableSprites.Add(new Rectangle(45, 360, 150, 50)); // TODO: use this.Content to load your game content here }
public void Remove(GameButton g) { Buttons.Remove(g); }