public OptionScreen(ScreenManager screenManager) : base(screenManager) { optionWidget = new MenuWidget(spriteBatch, "Textures\\UI\\bear", "Options Menu", -500, body.Center.X, body.Height / 2, body.Top, Widget.Anchor.TOP_CENTER); optionWidget.AddMenuItem("Back", ToMainScreen); widgets.Add(optionWidget); }
public GameScreen(ScreenManager screenManager) : base(screenManager) { camera = new Camera(); terrainManager = new TerrainManager(camera); terrainManager.GenerateTerrain("World 1"); }
/// <summary> /// Create a game screen. /// </summary> public Screen(ScreenManager screenManager) { this.screenManager = screenManager; spriteBatch = new SpriteBatch(screenManager.getGraphicsDeviceManager().GraphicsDevice); body = new Rectangle(0, 0, SettingsManager.GetInstance().ResolutionX, SettingsManager.GetInstance().ResolutionY); }
/// <summary> /// Initialization. /// </summary> protected override void Initialize() { AssetManager.GetInstance().LoadAssets(this.Content); SettingsManager.GetInstance().ApplyVideoSettings(graphicsDeviceManager); screenManager = new ScreenManager(graphicsDeviceManager); screenManager.SetScreen(new MainScreen(screenManager)); this.IsMouseVisible = true; this.IsFixedTimeStep = false; base.Initialize(); }
public MainScreen(ScreenManager screenManager) : base(screenManager) { //TextButtonWidget textButtonWidget = new TextButtonWidget(spriteBatch, "test", 0, body.Center.X, 0, body.Center.Y, Widget.Anchor.MID_CENTER); //menuWidget = new MenuWidget(spriteBatch, 0, body.Center.X, 0, body.Center.Y, Widget.Anchor.MID_CENTER); //menuWidget.AddMenuItem(new MenuItem("Play", removeMenu, "Fonts\\SpriteFont1")); //menuWidget.AddMenuItem(new MenuItem("Options", toOptionsScreen, "Fonts\\SpriteFont1")); //menuWidget = new MenuWidget(spriteBatch, "Textures\\UI\\bear", "Main Menu", 0, body.Center.X, 0, body.Top, Widget.Anchor.TOP_CENTER); //menuWidget = new MenuWidget(spriteBatch, "Textures\\UI\\bear", "Main Menu", 0, body.Center.X, 400, body.Top, Widget.Anchor.BOTTOM_CENTER); System.Diagnostics.Debug.WriteLine(body.Height); menuWidget = new MenuWidget(spriteBatch, "Textures\\UI\\bear", "Main Menu", -500, body.Center.X, body.Height/2 , body.Top, Widget.Anchor.TOP_CENTER); menuWidget.AddMenuItem("Play", ToGameScreen); menuWidget.AddMenuItem("Options", ToOptionsScreen); ModelDisplayWidget mdw = new ModelDisplayWidget(spriteBatch, "Textures\\UI\\temp", 500, body.Center.X, body.Height / 2, body.Top, Widget.Anchor.TOP_CENTER); widgets.Add(menuWidget); widgets.Add(mdw); //widgets.Add(new TextButtonWidget(spriteBatch, "jimmy beatle garbage pants", ToOptionsScreen, 0, body.Left, 0, body.Top, Widget.Anchor.TOP_LEFT)); }