protected override void LoadContent() { SpriteBatch = new SpriteBatch(GraphicsDevice); Renderer = new MonoGameRenderer(Scene); Renderer.CenterScreen(); }
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(); }
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); }
protected override void Initialize() { this.renderer = new MonoGameRenderer(); InputHandler.Initialize(); StateMachine.Initialize(); base.Initialize(); }
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(); }
protected override void Initialize() { Renderer = new MonoGameRenderer(); StateMachine.Initialize(); StateMachine.CurrentState = StateMachine.States["InitialState"]; StateMachine.CurrentState.Execute(); StateMachine.ChangeState(); base.Initialize(); }
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(); }
/// <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 }
/// <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(); }
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; } }
/// <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(); }
public override void Draw(MonoGameRenderer renderer) { renderer.DrawMenu(EntryPoint.Game.Elapsed); }
public abstract void Draw(GameTime gameTime, MonoGameRenderer renderer);
public virtual void Draw(MonoGameRenderer renderer) { }
public override void Draw(GameTime gameTime, MonoGameRenderer renderer) { renderer.ClearCharacter(character.PreviousPositionX, character.PreviousPositionY); renderer.DrawCharacter(character.CurrentPositionX, character.CurrentPositionY); }
public override void Draw(GameTime gameTime, MonoGameRenderer renderer) { throw new NotImplementedException(); }
public void Draw(MonoGameRenderer renderer) { renderer.DrawScreen(); }
//EVENTS AN DELEGATES private void EscapePressd(object source, EventArgs e) { MonoGameRenderer renderer = (MonoGameRenderer)source; Exit(); }
public override void Draw(GameTime gameTime, MonoGameRenderer renderer) { renderer.DrawMainMenu(MainMenu.ItemTextList, MainMenu.ItemPositionXList, MainMenu.ItemPositionYList); }
public override void Draw(GameTime gameTime, MonoGameRenderer renderer) { renderer.DrawLevelBuilder(); }