示例#1
0
        protected override void LoadContent()
        {
            SpriteBatch = new SpriteBatch(GraphicsDevice);
            Renderer    = new MonoGameRenderer(Scene);

            Renderer.CenterScreen();
        }
示例#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();
        }
示例#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);
        }
示例#4
0
        protected override void Initialize()
        {
            this.renderer = new MonoGameRenderer();
            InputHandler.Initialize();
            StateMachine.Initialize();

            base.Initialize();
        }
示例#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();
 }
示例#6
0
 protected override void Initialize()
 {
     Renderer = new MonoGameRenderer();
     StateMachine.Initialize();
     StateMachine.CurrentState = StateMachine.States["InitialState"];
     StateMachine.CurrentState.Execute();
     StateMachine.ChangeState();
     base.Initialize();
 }
示例#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();
 }
示例#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
        }
示例#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();
        }
示例#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;
            }
        }
示例#11
0
文件: Game.cs 项目: jdiperla/Hero6
        /// <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();
        }
示例#12
0
 public override void Draw(MonoGameRenderer renderer)
 {
     renderer.DrawMenu(EntryPoint.Game.Elapsed);
 }
示例#13
0
文件: States.cs 项目: archonza/Rad
 public abstract void Draw(GameTime gameTime, MonoGameRenderer renderer);
示例#14
0
 public virtual void Draw(MonoGameRenderer renderer)
 {
 }
示例#15
0
 public override void Draw(GameTime gameTime, MonoGameRenderer renderer)
 {
     renderer.ClearCharacter(character.PreviousPositionX, character.PreviousPositionY);
     renderer.DrawCharacter(character.CurrentPositionX, character.CurrentPositionY);
 }
示例#16
0
 public override void Draw(GameTime gameTime, MonoGameRenderer renderer)
 {
     throw new NotImplementedException();
 }
示例#17
0
文件: State.cs 项目: ahoeft/SnekGame
 public void Draw(MonoGameRenderer renderer)
 {
     renderer.DrawScreen();
 }
示例#18
0
        //EVENTS AN DELEGATES

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

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