예제 #1
0
파일: menu.cs 프로젝트: s-tc-chou/SSBB3DMV
        //initializer
        public void init()
        {
            m_base     = new List <worldobj>();
            m_lstItem1 = new List <worldobj>();
            m_lstItem2 = new List <worldobj>();
            m_lstItem3 = new List <worldobj>();
            m_lstItem4 = new List <worldobj>();
            m_lstItem5 = new List <worldobj>();

            curpos = new Vector2(0, 0);
            obj1   = new worldobj();
            obj1.spritePosition = Vector2.Zero;
        }
예제 #2
0
파일: Game1.cs 프로젝트: huhx0015/SSBB3DMV
        // "LoadContent()": will be called once per game and is the place to load
        // all of your content.
        protected override void LoadContent()
        {
            device = graphics.GraphicsDevice; // Initializes the graphics device.
            effect = Content.Load<Effect>("Effects\\effects"); // Loads the specified effect.
            SetUpCamera(); // Sets up the camera position.

            titleScreen = Content.Load<Texture2D>("Title\\Title"); // Loads the title screen.
            loadScreen = Content.Load<Texture2D>("Title\\Loading"); // Loads the title screen.

            inputState.musicPlay("Menu_1"); // Plays the default song on load.
            mymenu.songString = "SONG: Menu 1 [Super Smash Bros. Brawl]";

            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            spriteBatch1 = new SpriteBatch(GraphicsDevice);

            Font1 = Content.Load<SpriteFont>("Fonts\\Verdana"); // Sets the font to 'Verdana'.
            FontPos = new Vector2((graphics.GraphicsDevice.Viewport.Width * 0.50f), graphics.GraphicsDevice.Viewport.Height - 14); // Sets the font position.

            // Loads the 2D textures into the program.
            background = Content.Load<Texture2D>("Textures\\Sky"); // Loads the background image.
            fdbackground = Content.Load<Texture2D>("Textures\\Stars"); // Loads the star background for Final Destination.
            currentbackground = background; // Uses the sky background as the default stage background.

            // Load menu textures.
            icon1 = Content.Load<Texture2D>("GUI\\Menu");
            icon2 = Content.Load<Texture2D>("GUI\\Characters");
            // TO DO: PUT IN REAL TEXTURES FOR THE MENU ICONS.
            mymenu.Texture = icon1;
            mymenu.setSub1 = icon2;
            mymenu.setSub2 = icon2;
            mymenu.setSub3 = icon2;
            mymenu.setSub4 = icon2;
            mymenu.setSub5 = icon2;

            Source = new Rectangle[]
                     {
                         new Rectangle(0, 0, 105, 95),
                         new Rectangle(100, 0, 105, 95),
                         new Rectangle(205, 0, 105, 95),
                         new Rectangle(305, 0, 105, 95),
                         new Rectangle(405, 0, 105, 95)
                     };
            Sourcesub = new Rectangle[]
                     {
                         new Rectangle(0, 0, 128, 128),
                         new Rectangle(128, 0, 128, 128),
                         new Rectangle(256, 0, 128, 128),
                         new Rectangle(384, 0, 128, 128)
                     };

            //TODO: ADD MORE SOURCE - added 1 sub menu
            mymenu.Source = Source;
            mymenu.Submenu = Sourcesub;

            //TODO: CHANGE TO NONSTATIC
            Color temptint = new Color();
            temptint.R = 255;
            temptint.G = 255;
            temptint.B = 255;
            temptint.A = 255;
            //add top menu
            for (int i = 0; i < 5; i++)
            {
                basemenu = new worldobj();
                basemenu.spritePosition.X = Source[i].X;
                basemenu.spritePosition.Y = Source[i].Y;
                basemenu.width = 105;
                basemenu.height = 95;
                basemenu.show = true;
                basemenu.tint = temptint;
                mymenu.Add(basemenu);
            }

            //TO-DO adding submenus... not working

            for (int i = 0; i < 4; i++)
            {
                int tempadd = 128;
                //TODO: INITIALIZE OTHER VARIABLES FOR SUB MENUS.
                obj2 = new worldobj();
                obj3 = new worldobj();
                obj4 = new worldobj();
                obj5 = new worldobj();
                obj6 = new worldobj();

                //INITIALIZE OBJECT 2 AND PASS IT IN.... but how to change pos?
                obj2.spritePosition.X = Sourcesub[i].X + tempadd * 0;
                obj2.spritePosition.Y = Sourcesub[i].Y + 128;
                obj2.width = 128;
                obj2.height = 128;
                obj2.show = false;
                obj2.tint = temptint;

                //2nd obj
                obj3.spritePosition.X = Sourcesub[i].X + tempadd * 1;
                obj3.spritePosition.Y = Sourcesub[i].Y + 128;
                obj3.width = 128;
                obj3.height = 128;
                obj3.show = false;
                obj3.tint = temptint;
                //3rd obj
                obj4.spritePosition.X = Sourcesub[i].X + tempadd * 2;
                obj4.spritePosition.Y = Sourcesub[i].Y + 128;
                obj4.width = 128;
                obj4.height = 128;
                obj4.show = false;
                obj4.tint = temptint;
                //4th obj
                obj5.spritePosition.X = Sourcesub[i].X + tempadd * 3;
                obj5.spritePosition.Y = Sourcesub[i].Y + 128;
                obj5.width = 128;
                obj5.height = 128;
                obj5.show = false;
                obj5.tint = temptint;
                //5th obj
                obj6.spritePosition.X = Sourcesub[i].X + tempadd * 4;
                obj6.spritePosition.Y = Sourcesub[i].Y + 128;
                obj6.width = 128;
                obj6.height = 128;
                obj6.show = false;
                obj6.tint = temptint;

                //add the items
                mymenu.AddSub1(obj2);
                mymenu.AddSub2(obj3);
                mymenu.AddSub3(obj4);
                mymenu.AddSub4(obj5);
                mymenu.AddSub5(obj6);

            }

            mainFrame = new Rectangle(0, 0, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height); // Set the rectangle parameters.
            mymenu.Frame = mainFrame;
            aspectRatio = (float)graphics.GraphicsDevice.Viewport.Width / (float)graphics.GraphicsDevice.Viewport.Height; // Set the aspect ratio.
        }
예제 #3
0
        // "LoadContent()": will be called once per game and is the place to load
        // all of your content.
        protected override void LoadContent()
        {
            device = graphics.GraphicsDevice;                         // Initializes the graphics device.
            effect = Content.Load <Effect>("Effects\\effects");       // Loads the specified effect.
            SetUpCamera();                                            // Sets up the camera position.

            titleScreen = Content.Load <Texture2D>("Title\\Title");   // Loads the title screen.
            loadScreen  = Content.Load <Texture2D>("Title\\Loading"); // Loads the title screen.

            inputState.musicPlay("Menu_1");                           // Plays the default song on load.
            mymenu.songString = "SONG: Menu 1 [Super Smash Bros. Brawl]";

            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch  = new SpriteBatch(GraphicsDevice);
            spriteBatch1 = new SpriteBatch(GraphicsDevice);

            Font1   = Content.Load <SpriteFont>("Fonts\\Verdana");                                                                 // Sets the font to 'Verdana'.
            FontPos = new Vector2((graphics.GraphicsDevice.Viewport.Width * 0.50f), graphics.GraphicsDevice.Viewport.Height - 14); // Sets the font position.

            // Loads the 2D textures into the program.
            background        = Content.Load <Texture2D>("Textures\\Sky");   // Loads the background image.
            fdbackground      = Content.Load <Texture2D>("Textures\\Stars"); // Loads the star background for Final Destination.
            currentbackground = background;                                  // Uses the sky background as the default stage background.

            // Load menu textures.
            icon1 = Content.Load <Texture2D>("GUI\\Menu");
            icon2 = Content.Load <Texture2D>("GUI\\Characters");
            // TO DO: PUT IN REAL TEXTURES FOR THE MENU ICONS.
            mymenu.Texture = icon1;
            mymenu.setSub1 = icon2;
            mymenu.setSub2 = icon2;
            mymenu.setSub3 = icon2;
            mymenu.setSub4 = icon2;
            mymenu.setSub5 = icon2;

            Source = new Rectangle[]
            {
                new Rectangle(0, 0, 105, 95),
                new Rectangle(100, 0, 105, 95),
                new Rectangle(205, 0, 105, 95),
                new Rectangle(305, 0, 105, 95),
                new Rectangle(405, 0, 105, 95)
            };
            Sourcesub = new Rectangle[]
            {
                new Rectangle(0, 0, 128, 128),
                new Rectangle(128, 0, 128, 128),
                new Rectangle(256, 0, 128, 128),
                new Rectangle(384, 0, 128, 128)
            };

            //TODO: ADD MORE SOURCE - added 1 sub menu
            mymenu.Source  = Source;
            mymenu.Submenu = Sourcesub;

            //TODO: CHANGE TO NONSTATIC
            Color temptint = new Color();

            temptint.R = 255;
            temptint.G = 255;
            temptint.B = 255;
            temptint.A = 255;
            //add top menu
            for (int i = 0; i < 5; i++)
            {
                basemenu = new worldobj();
                basemenu.spritePosition.X = Source[i].X;
                basemenu.spritePosition.Y = Source[i].Y;
                basemenu.width            = 105;
                basemenu.height           = 95;
                basemenu.show             = true;
                basemenu.tint             = temptint;
                mymenu.Add(basemenu);
            }

            //TO-DO adding submenus... not working

            for (int i = 0; i < 4; i++)
            {
                int tempadd = 128;
                //TODO: INITIALIZE OTHER VARIABLES FOR SUB MENUS.
                obj2 = new worldobj();
                obj3 = new worldobj();
                obj4 = new worldobj();
                obj5 = new worldobj();
                obj6 = new worldobj();

                //INITIALIZE OBJECT 2 AND PASS IT IN.... but how to change pos?
                obj2.spritePosition.X = Sourcesub[i].X + tempadd * 0;
                obj2.spritePosition.Y = Sourcesub[i].Y + 128;
                obj2.width            = 128;
                obj2.height           = 128;
                obj2.show             = false;
                obj2.tint             = temptint;

                //2nd obj
                obj3.spritePosition.X = Sourcesub[i].X + tempadd * 1;
                obj3.spritePosition.Y = Sourcesub[i].Y + 128;
                obj3.width            = 128;
                obj3.height           = 128;
                obj3.show             = false;
                obj3.tint             = temptint;
                //3rd obj
                obj4.spritePosition.X = Sourcesub[i].X + tempadd * 2;
                obj4.spritePosition.Y = Sourcesub[i].Y + 128;
                obj4.width            = 128;
                obj4.height           = 128;
                obj4.show             = false;
                obj4.tint             = temptint;
                //4th obj
                obj5.spritePosition.X = Sourcesub[i].X + tempadd * 3;
                obj5.spritePosition.Y = Sourcesub[i].Y + 128;
                obj5.width            = 128;
                obj5.height           = 128;
                obj5.show             = false;
                obj5.tint             = temptint;
                //5th obj
                obj6.spritePosition.X = Sourcesub[i].X + tempadd * 4;
                obj6.spritePosition.Y = Sourcesub[i].Y + 128;
                obj6.width            = 128;
                obj6.height           = 128;
                obj6.show             = false;
                obj6.tint             = temptint;

                //add the items
                mymenu.AddSub1(obj2);
                mymenu.AddSub2(obj3);
                mymenu.AddSub3(obj4);
                mymenu.AddSub4(obj5);
                mymenu.AddSub5(obj6);
            }

            mainFrame    = new Rectangle(0, 0, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height);             // Set the rectangle parameters.
            mymenu.Frame = mainFrame;
            aspectRatio  = (float)graphics.GraphicsDevice.Viewport.Width / (float)graphics.GraphicsDevice.Viewport.Height; // Set the aspect ratio.
        }
예제 #4
0
파일: menu.cs 프로젝트: huhx0015/SSBB3DMV
        //initializer
        public void init()
        {
            m_base = new List<worldobj>();
            m_lstItem1 = new List<worldobj>();
            m_lstItem2 = new List<worldobj>();
            m_lstItem3 = new List<worldobj>();
            m_lstItem4 = new List<worldobj>();
            m_lstItem5 = new List<worldobj>();

            curpos = new Vector2(0, 0);
            obj1 = new worldobj();
            obj1.spritePosition = Vector2.Zero;
        }
예제 #5
0
파일: menu.cs 프로젝트: huhx0015/SSBB3DMV
 public void AddSub5(worldobj item)
 {
     m_lstItem5.Add(item);
 }
예제 #6
0
파일: menu.cs 프로젝트: huhx0015/SSBB3DMV
 public void AddSub4(worldobj item)
 {
     m_lstItem4.Add(item);
 }
예제 #7
0
파일: menu.cs 프로젝트: huhx0015/SSBB3DMV
 public void AddSub3(worldobj item)
 {
     m_lstItem3.Add(item);
 }
예제 #8
0
파일: menu.cs 프로젝트: huhx0015/SSBB3DMV
 public void AddSub2(worldobj item)
 {
     m_lstItem2.Add(item);
 }
예제 #9
0
파일: menu.cs 프로젝트: huhx0015/SSBB3DMV
 public void AddSub1(worldobj item)
 {
     m_lstItem1.Add(item);
 }
예제 #10
0
파일: menu.cs 프로젝트: huhx0015/SSBB3DMV
 //add an item to the index
 public void Add(worldobj item)
 {
     m_base.Add(item);
 }
예제 #11
0
파일: menu.cs 프로젝트: s-tc-chou/SSBB3DMV
 public void AddSub5(worldobj item)
 {
     m_lstItem5.Add(item);
 }
예제 #12
0
파일: menu.cs 프로젝트: s-tc-chou/SSBB3DMV
 public void AddSub4(worldobj item)
 {
     m_lstItem4.Add(item);
 }
예제 #13
0
파일: menu.cs 프로젝트: s-tc-chou/SSBB3DMV
 public void AddSub3(worldobj item)
 {
     m_lstItem3.Add(item);
 }
예제 #14
0
파일: menu.cs 프로젝트: s-tc-chou/SSBB3DMV
 public void AddSub2(worldobj item)
 {
     m_lstItem2.Add(item);
 }
예제 #15
0
파일: menu.cs 프로젝트: s-tc-chou/SSBB3DMV
 public void AddSub1(worldobj item)
 {
     m_lstItem1.Add(item);
 }
예제 #16
0
파일: menu.cs 프로젝트: s-tc-chou/SSBB3DMV
 //add an item to the index
 public void Add(worldobj item)
 {
     m_base.Add(item);
 }