root/Code/oMaE/oMaE/Screens/Inventory.cs @ 41

Revision 41, 1.7 KB (checked in by acarter, 2 years ago)

More comments/refactoring

Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using Microsoft.Xna.Framework;
6using Microsoft.Xna.Framework.Audio;
7using Microsoft.Xna.Framework.Content;
8using Microsoft.Xna.Framework.GamerServices;
9using Microsoft.Xna.Framework.Graphics;
10using Microsoft.Xna.Framework.Input;
11using Microsoft.Xna.Framework.Media;
12using oMaE.Widgets;
13
14namespace oMaE.Screens
15{
16    using Overworld;
17    /// <summary>
18    /// The current inventory of the player.
19    /// </summary>
20    public class Inventory : GameObject, IButtonListener
21    {
22        /// <summary>
23        /// Initializes the inventory screen.
24        /// </summary>
25        public override void Initialize()
26        {
27            children.Add(driver.Screens.createScreenButton(new Rectangle(0, 0, 200, 50), "Inventory", SCREENS.INVENTORY));
28            children.Add(driver.Screens.createScreenButton(new Rectangle(200, 0, 200, 50), "Encyclophant", SCREENS.ENCYCLOPHANT));
29            children.Add(new Button(new Rectangle(800, 0, 200, 50), "Back").addButtonListener(this));
30            base.Initialize();
31        }
32        /// <summary>
33        /// Updates when a button is clicked.
34        /// </summary>
35        /// <param name="button">The button which was clicked.</param>
36        public void ButtonLeftClicked(Button button)
37        {
38            driver.CloseScreen();
39        }
40        /// <summary>
41        /// Draws the inventory to the screen.
42        /// </summary>
43        /// <param name="screen">The screen that is drawn on.</param>
44        public override void Draw(Screen2D screen)
45        {
46            screen.FillRectangle(new Rectangle(0, 0, 200, 50), Color.Bisque);
47            base.Draw(screen);
48        }
49    }
50}
Note: See TracBrowser for help on using the browser.