Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
        public GameScreen(ScreenManager screenManager)
            : base(screenManager)
        {
            camera = new Camera();
            terrainManager = new TerrainManager(camera);

            terrainManager.GenerateTerrain("World 1");
        }
Ejemplo n.º 3
0
        /// <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);
        }
Ejemplo n.º 4
0
        /// <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();
        }
Ejemplo n.º 5
0
        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));
        }