コード例 #1
0
 static void Main()
 {
     using (var game = new Engine_Core())
     {
         //Begin Engine Execution / Run the Game
         game.Run();
     }
 }
コード例 #2
0
        /// <summary>
        /// Initialization Method
        /// </summary>
        public Dialogue(Engine_Core coreRef)
        {
            //Cast to the interface in order to call interface functions
            myInterface = this;

            //Retain a reference to the Engine_Core
            engCoreRef = coreRef;

            //Run the core state function
            Console.WriteLine("Activating Dialogue State!");
            myInterface.Main();
        }
コード例 #3
0
        //Initialization method
        public Front_End_UI(Front_End curState, Engine_Core coreRef, IGame_State_Base stateInterface)
        {
            //Store references
            stateFunctions = stateInterface;
            engCoreRef     = coreRef;
            state          = curState;

            //---------------GENERATE BUTTONS---------------

            //Create the Start Game Button
            Base_Button.ClickEvent clickEvent = GoToGame;
            startGameButton = new Base_Button(
                new Sprite()
            {
                Texture = engCoreRef.Content.Load <Texture2D>("UI/Front_End/Test_Button"),
                Color   = Color.White,
                Size    = new Rectangle(engCoreRef.GraphicsDevice.Viewport.Width / 2 - 128, (engCoreRef.GraphicsDevice.Viewport.Height / 2) - 32, 256, 64)
            },
                new TextSprite()
            {
                Font  = engCoreRef.Content.Load <SpriteFont>("UI/Fonts/Menu_Button_01"),
                Text  = "Start Game",
                Color = Color.White
            },
                clickEvent);

            //Create the Exit Game Button
            clickEvent     = ExitGame;
            exitGameButton = new Base_Button(
                new Sprite()
            {
                Texture = engCoreRef.Content.Load <Texture2D>("UI/Front_End/Test_Button"),
                Color   = Color.White,
                Size    = new Rectangle(engCoreRef.GraphicsDevice.Viewport.Width / 2 - 128, (engCoreRef.GraphicsDevice.Viewport.Height / 2) + (engCoreRef.GraphicsDevice.Viewport.Height / 6) - 32, 256, 64)
            },
                new TextSprite()
            {
                Font  = engCoreRef.Content.Load <SpriteFont>("UI/Fonts/Menu_Button_01"),
                Text  = "Exit Game",
                Color = Color.White
            },
                clickEvent);

            //Add the buttons to the draw stack
            engCoreRef.drawStack.Add("Start_Game_Button", startGameButton.myArt);
            engCoreRef.textDrawStack.Add("Start_Game_Button_Text", startGameButton.myText);
            engCoreRef.drawStack.Add("Exit_Game_Button", exitGameButton.myArt);
            engCoreRef.textDrawStack.Add("Exit_Game_Button_Text", exitGameButton.myText);
        }
コード例 #4
0
        /// <summary>
        /// Initialization Method
        /// </summary>
        public Front_End(Engine_Core coreRef)
        {
            //Cast to the interface in order to call interface functions
            myInterface = this;

            //Retain a reference to the Engine_Core
            engCoreRef = coreRef;

            //Generate the U.I Class
            frontEndUI = new Front_End_UI(this, engCoreRef, myInterface);

            //Run the core state function
            Console.WriteLine("Activating Front-End!");
            myInterface.Main();
        }
コード例 #5
0
        //Main Initialization Method
        public Dialogue_UI(Engine_Core coreRef)
        {
            //Grab References
            engCoreRef = coreRef;

            //Initialize the Content Managers
            characterManager  = new ContentManager(engCoreRef.Content.ServiceProvider);
            backgroundManager = new ContentManager(engCoreRef.Content.ServiceProvider);
            characterManager.RootDirectory  = "Content";
            backgroundManager.RootDirectory = "Content";

            //Create the Dialogue Frame Art
            dialogueBoxArt = new Sprite()
            {
                Texture = engCoreRef.Content.Load <Texture2D>("UI/Front_End/Test_Button"),
                Color   = Color.White,
                Size    = new Rectangle(0, (engCoreRef.GraphicsDevice.Viewport.Height / 2) + (engCoreRef.GraphicsDevice.Viewport.Height / 4), engCoreRef.GraphicsDevice.Viewport.Width, (engCoreRef.GraphicsDevice.Viewport.Height / 4)),
            };
            nameBoxArt = new Sprite()
            {
                Texture = engCoreRef.Content.Load <Texture2D>("UI/Front_End/Test_Button"),
                Color   = Color.White,
                Size    = new Rectangle(0, dialogueBoxArt.Size.Location.Y - (dialogueBoxArt.Size.Size.Y / 4), dialogueBoxArt.Size.Size.X / 6, dialogueBoxArt.Size.Size.Y / 4)
            };

            //Create the empty, placeholder Character Art objects
            speakerArt = new Sprite()
            {
                Texture     = new Texture2D(engCoreRef.GraphicsDevice, 1, 1),
                Color       = Color.White,
                Size        = new Rectangle(25, 25, 400, 768),
                RenderLayer = 0.1f
            };

            //Create the Background Art object
            backgroundArt = new Sprite()
            {
                Texture     = backgroundManager.Load <Texture2D>("Backgrounds/Classroom_01"),
                Color       = Color.White,
                Size        = new Rectangle(0, 0, engCoreRef.GraphicsDevice.Viewport.Width, engCoreRef.GraphicsDevice.Viewport.Height),
                RenderLayer = 0.0f
            };

            //Create the Dialogue Text elements
            nameText = new TextSprite()
            {
                Font  = engCoreRef.Content.Load <SpriteFont>("UI/Fonts/Menu_Button_01"),
                Text  = "",
                Color = Color.White,
                Pos   = new Vector2((nameBoxArt.Size.X + nameBoxArt.Size.Width / 2), (nameBoxArt.Size.Y + nameBoxArt.Size.Height / 2))
            };
            nameText.Origin = nameText.Font.MeasureString(nameText.Text) / 2;
            dialogueText    = new TextSprite()
            {
                Font  = engCoreRef.Content.Load <SpriteFont>("UI/Fonts/Menu_Button_01"),
                Text  = "",
                Color = Color.White,
                Pos   = new Vector2(dialogueBoxArt.Size.X + 20, dialogueBoxArt.Size.Y + 10)
            };

            //Add the  dialogue U.I elements to the render stack
            engCoreRef.drawStack.Add("Dialogue_Box", dialogueBoxArt);
            engCoreRef.drawStack.Add("Name_Box", nameBoxArt);
            engCoreRef.textDrawStack.Add("Character_Text", nameText);
            engCoreRef.textDrawStack.Add("Dialogue_Text", dialogueText);
            engCoreRef.drawStack.Add("Speaker_Art", speakerArt);
            engCoreRef.drawStack.Add("Background_Art", backgroundArt);
        }