Example #1
0
        public tutorialScreen(int w, int h, ContentManager content,
                            GraphicsDeviceManager _graphics)
            : base(0,0,w,h)
        {
            instance = this;
            graphicsH = _graphics.PreferredBackBufferHeight;
            graphicsW = _graphics.PreferredBackBufferWidth;
            //add the panels for the screen interfaces
            UI.ImageLabel tutorialBackground = new UI.ImageLabel
                                (0, _graphics.PreferredBackBufferHeight - panelHeight,
                                content.Load<Texture2D>("menuImages/gameInterfacePanel"));
            tutorialBackground.resize(_graphics.PreferredBackBufferWidth, panelHeight);
            addComponent(tutorialBackground);//panel across the bottom that says tutorial

             Point location = tutorialBackground.getPos();

             UI.ImageLabel tutorialTitle = new UI.ImageLabel(location.X, location.Y, content.Load<Texture2D>("menuImages/tutorialLeveltext"));
             addComponent(tutorialTitle);

             //tutorial header
             tutorialBoxHeader = new UI.ImageLabel((_graphics.PreferredBackBufferWidth / 4)+20, 20, content.Load<Texture2D>("menuImages/tutorialtipbox"));
             //tutorialBoxBackground.resize(panelWidth / 4, panelWidth / 3);
             tutorialBoxHeader.resize(panelWidth / 4, panelWidth / 15);
             addComponent(tutorialBoxHeader);

             location = tutorialBoxHeader.getPos();

             tutorialHeaderText = new UI.TextLabel(location.X, location.Y, tutorialBoxHeader.getWidth(), tutorialBoxHeader.getHeight(),tutorialHeader, Color.White);
             tutorialHeaderText.changeFontScale(0.3f);
             addComponent(tutorialHeaderText);

             //UI.TextLabel tutorialTitle = new UI.TextLabel(location.X, location.Y+20, 1280, 20, "Tutorial Level", Color.White);
             //tutorialTitle.changeFontScale(1);
             //addComponent(tutorialTitle);
             tutorialBoxBackground = new UI.ImageLabel(20, 20,content.Load<Texture2D>("menuImages/tutorialtipbox"));
             //tutorialBoxBackground.resize(panelWidth / 4, panelWidth / 3);
             tutorialBoxBackground.resize(panelWidth / 4, panelWidth / 8);
             addComponent(tutorialBoxBackground);

             location = tutorialBoxBackground.getPos();

            tutorialText = new UI.TextLabel(location.X,location.Y,tutorialBoxBackground.getWidth(), tutorialBoxBackground.getHeight(),tutorialInfo, Color.White);
            tutorialText.changeFontScale(0.3f);
             addComponent(tutorialText);

             menuPanelTutorial = new inGameMenu(w, h, content, _graphics);
             addComponent(menuPanelTutorial);
        }
Example #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        /// 
        //test the scene Model
        //Model myScene;
        ////the aspect ratio determines how to scale 3d to 3d projection
        //float aspectRatio;
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // load your game content

            //myScene = Content.Load<Model>("Models\\chickenScene");
            //aspectRatio = graphics.GraphicsDevice.Viewport.AspectRatio;

            new AudioManager(Content);
            UI.Component.font = Content.Load<SpriteFont>("UIFont");
            UI.PushButton.disabledTexture = Content.Load<Texture2D>("MenuImages/darkMenuPaneltrans50");

            //load the menu screens
            startScreen = new GameUI.startMenuScreen(graphics.GraphicsDevice.Viewport.Width,
                graphics.GraphicsDevice.Viewport.Height, Content);
            gameInterfaceScreen = new GameUI.gameInterface(graphics.GraphicsDevice.Viewport.Width,
                graphics.GraphicsDevice.Viewport.Height, Content, graphics);
            helpScreen = new GameUI.helpScreen(graphics.GraphicsDevice.Viewport.Width,
                graphics.GraphicsDevice.Viewport.Height, Content);
            optionsScreen = new GameUI.optionsMenuScreen(graphics.GraphicsDevice.Viewport.Width,
                graphics.GraphicsDevice.Viewport.Height, Content);
            creditsScreen = new GameUI.creditsScreen(graphics.GraphicsDevice.Viewport.Width,
                graphics.GraphicsDevice.Viewport.Height, Content);
            newGameScreen = new GameUI.NewGameMenu(graphics.GraphicsDevice.Viewport.Width,
                graphics.GraphicsDevice.Viewport.Height, Content);
            splashScreen = new GameUI.splashScreen(graphics.GraphicsDevice.Viewport.Width,
                graphics.GraphicsDevice.Viewport.Height, Content);
            winlossScreen = new GameUI.VictoryLossScreen(graphics.GraphicsDevice.Viewport.Width,
                graphics.GraphicsDevice.Viewport.Height, Content);
            tutorialScreen = new GameUI.tutorialScreen(graphics.GraphicsDevice.Viewport.Width,
               graphics.GraphicsDevice.Viewport.Height, Content, graphics);

            mouseCursor = new UI.MouseCursor(0, 0, Content.Load<Texture2D>("MenuImages/triangleIcon"));
            mouseCursor.resize(40, 40);
            startScreen.addComponent(mouseCursor);

            helpScreen.addComponent(mouseCursor);
            optionsScreen.addComponent(mouseCursor);
            creditsScreen.addComponent(mouseCursor);
            newGameScreen.addComponent(mouseCursor);
            winlossScreen.addComponent(mouseCursor);
            gameInterfaceScreen.addComponent(mouseCursor);
            GameUI.tutorialScreen.instance.menuPanelTutorial.addComponent(mouseCursor);
            setGameState(GameState.splash);
            Chicken.AudioManager.instance.roosterSpawnSound.Play(0.3f,0f,0f);
        }