Esempio n. 1
0
        protected override void LoadContent()
        {
            SpriteBatch = new SpriteBatch(GraphicsDevice);
            Renderer    = new MonoGameRenderer(Scene);

            Renderer.CenterScreen();
        }
Esempio n. 2
0
        public void Initialize(GraphicsDeviceManager graphicsDeviceManager)
        {
            _graphicsDeviceManager = graphicsDeviceManager;

            Platform.Init(new Gwen.Platform.MonoGame.MonoGamePlatform());
            Gwen.Loader.LoaderBase.Init(new Gwen.Loader.MonoGame.MonoGameAssetLoader(Game.Content));

            _renderer = new MonoGameRenderer(GraphicsDevice, Game.Content, Game.Content.Load <Effect>("Gwen/Shaders/GwenEffect"));
            _renderer.Resize(graphicsDeviceManager.PreferredBackBufferWidth, graphicsDeviceManager.PreferredBackBufferHeight);

            _skin             = new TexturedBase(_renderer, "Gwen/Skins/DefaultSkin");
            _skin.DefaultFont = new Font(_renderer, "Gwen/Fonts/Arial", 11);
            _canvas           = new Canvas(_skin);
            _input            = new MonoGameInput(Game);
            _input.Initialize(_canvas);

            _canvas.SetSize(graphicsDeviceManager.PreferredBackBufferWidth, graphicsDeviceManager.PreferredBackBufferHeight);
            _canvas.ShouldDrawBackground = false;
            _canvas.BackgroundColor      = new Gwen.Color(255, 150, 170, 170);

            graphicsDeviceManager.PreparingDeviceSettings += OnPreparingDeviceSettings;
            Game.Window.AllowUserResizing  = true;
            Game.IsMouseVisible            = true;
            Game.Window.ClientSizeChanged += OnClientSizeChanged;

            BuildUI();
        }
Esempio n. 3
0
        public static void Initialise(MonoGameRenderer renderer)
        {
            //levelCompleteState = new LevelCompleteState(nextLevelState);
            //nextLevelState = new NextLevelState(levelInProgressState);
            collusionManager = new CollusionManager();
            level            = new LevelOne(null, collusionManager);
            character        = new Character(level, collusionManager);

            gameInProgressState   = new GameInProgressState(initialState, level, character);
            drawCompleteState     = new DrawCompleteState(initialState);
            drawCharacterState    = new DrawCharacterState(initialState, character);
            drawLevelState        = new DrawLevelState(initialState, level);
            drawLevelBuilderState = new DrawLevelBuilderState(initialState);
            drawMainMenuState     = new DrawMainMenuState(initialState);
            initialState          = new InitialState(drawMainMenuState);
            //displayMainMenuState.NextState = displayLevelBuilderState;
            //displayLevelBuilderState.NextState = initialState;
            //displayLevelState.NextState = initialState;
            //levelInProgressState.NextState = levelCompleteState;
            //levelCompleteState.NextState = nextLevelState;
            //nextLevelState.NextState = levelInProgressState;

            States.Add("InitialState", initialState);
            States.Add("DrawMainMenuState", drawMainMenuState);
            States.Add("DrawLevelBuilderState", drawLevelBuilderState);
            States.Add("DrawLevelState", drawLevelState);
            States.Add("DrawCharacterState", drawCharacterState);
            States.Add("DrawCompleteState", drawCompleteState);
            States.Add("GameInProgressState", gameInProgressState);
            //States.Add("LevelCompleteState", levelCompleteState);
            //States.Add("NextLevelState", nextLevelState);
        }
Esempio n. 4
0
        protected override void Initialize()
        {
            this.renderer = new MonoGameRenderer();
            InputHandler.Initialize();
            StateMachine.Initialize();

            base.Initialize();
        }
Esempio n. 5
0
 public override void Draw(GameTime gameTime, MonoGameRenderer renderer)
 {
     //NextState = StateController.States["DrawCompleteState"];
     //StateController.ChangeState();
     renderer.DrawCharacter(character.CurrentPositionX, character.CurrentPositionY);
     NextState = StateController.States["DrawCompleteState"];
     StateController.ChangeState();
 }
Esempio n. 6
0
 protected override void Initialize()
 {
     Renderer = new MonoGameRenderer();
     StateMachine.Initialize();
     StateMachine.CurrentState = StateMachine.States["InitialState"];
     StateMachine.CurrentState.Execute();
     StateMachine.ChangeState();
     base.Initialize();
 }
Esempio n. 7
0
 public override void Draw(GameTime gameTime, MonoGameRenderer renderer)
 {
     renderer.DrawLevel(LevelManager.Number);
     NextState = StateController.States["DrawCharacterState"];
     StateController.ChangeState();
     //NextState = StateController.States["MoveCharacterState"];
     //StateController.ChangeState();
     //renderer.DrawCharacter(Character.CurrentPositionX, Character.CurrentPositionY);
     //renderer.DrawCharacter();
 }
Esempio n. 8
0
        /// <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);
            monoGameRenderer = new MonoGameRenderer(this, graphics, Content);

            //eventSystem.transform.parent = main.transform;

            // TODO: use this.Content to load your game content here
        }
Esempio n. 9
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            graphics.PreferredBackBufferWidth  = 800;
            graphics.PreferredBackBufferHeight = 600;
            IsFixedTimeStep = true; // Ensure draw is always called after update
            //graphics.ToggleFullScreen();
            graphics.ApplyChanges();

            // TODO: Add your initialization logic here
            renderer = new MonoGameRenderer();

            StateController.Initialise(renderer);
            StateController.CurrentState = StateController.States["InitialState"];
            StateController.CurrentState.Execute(null);
            StateController.ChangeState();

            base.Initialize();
        }
Esempio n. 10
0
        protected override void UnloadContent()
        {
            base.UnloadContent();

            if (_canvas != null)
            {
                _canvas.Dispose();
                _canvas = null;
            }
            if (_skin != null)
            {
                _skin.Dispose();
                _skin = null;
            }
            if (_renderer != null)
            {
                _renderer.Dispose();
                _renderer = null;
            }
        }
Esempio n. 11
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            Util.Logger.Info("Initializing Hero6 game instance.");

            Window.Title = "Hero6";

            this.SetScale();

            this.spriteBatch = new SpriteBatch(GraphicsDevice);

            Renderer = new MonoGameRenderer(this.spriteBatch);

            this.ui = new UserInterfaceHandler(this.Content);

            this.campaign = new CampaignHandler(this.Content, this.ui);

            this.ui.Initialize();
            this.campaign.Initialize();

            Util.Logger.Info("Hero6 game instance initialized.");

            base.Initialize();
        }
Esempio n. 12
0
 public override void Draw(MonoGameRenderer renderer)
 {
     renderer.DrawMenu(EntryPoint.Game.Elapsed);
 }
Esempio n. 13
0
 public abstract void Draw(GameTime gameTime, MonoGameRenderer renderer);
Esempio n. 14
0
 public virtual void Draw(MonoGameRenderer renderer)
 {
 }
Esempio n. 15
0
 public override void Draw(GameTime gameTime, MonoGameRenderer renderer)
 {
     renderer.ClearCharacter(character.PreviousPositionX, character.PreviousPositionY);
     renderer.DrawCharacter(character.CurrentPositionX, character.CurrentPositionY);
 }
Esempio n. 16
0
 public override void Draw(GameTime gameTime, MonoGameRenderer renderer)
 {
     throw new NotImplementedException();
 }
Esempio n. 17
0
 public void Draw(MonoGameRenderer renderer)
 {
     renderer.DrawScreen();
 }
Esempio n. 18
0
        //EVENTS AN DELEGATES

        private void EscapePressd(object source, EventArgs e)
        {
            MonoGameRenderer renderer = (MonoGameRenderer)source;

            Exit();
        }
Esempio n. 19
0
 public override void Draw(GameTime gameTime, MonoGameRenderer renderer)
 {
     renderer.DrawMainMenu(MainMenu.ItemTextList, MainMenu.ItemPositionXList, MainMenu.ItemPositionYList);
 }
Esempio n. 20
0
 public override void Draw(GameTime gameTime, MonoGameRenderer renderer)
 {
     renderer.DrawLevelBuilder();
 }