protected override void Initialize() { graphics.PreferredBackBufferWidth = 240 * 3; graphics.ApplyChanges(); scenemanager = new SceneManager(Content, graphics.GraphicsDevice); //scenemanager.addScene(new PlaygroundScene(0,0,320,480,Content, graphics.GraphicsDevice)); string[] menuText = {"New Game","Continue","Settings","End Game"}; Scene[] menuDest = new Scene[1]; menuDest[0] = new PlaygroundScene(0,0,320,480,Content, graphics.GraphicsDevice,scenemanager); scenemanager.addScene(new MainMenu(0, 0, 320, 480, Content, graphics.GraphicsDevice,scenemanager,menuText,menuDest)); //add Menu screen here }
public MainMenu(int x, int y, int h, int w,ContentManager cm, GraphicsDevice gd, SceneManager sm ,string[] title,Scene[] destination) { this.x = x; this.y = y; this.width = w; this.height = h; _contentManager = cm; _graphicsDevice = gd; this.sceneManager = sm; this.title = title.ToArray(); this.destination = destination.ToArray(); Initilize(); LoadContent(); }
protected override void Initialize() { spritebatch = new SpriteBatch(GraphicsDevice); graphics.PreferredBackBufferWidth = 240 * 3; graphics.ApplyChanges(); scenemanager = new SceneManager(Content, graphics.GraphicsDevice); //scenemanager.addScene(new PlaygroundScene(0,0,320,480,Content, graphics.GraphicsDevice)); string[] menuText = { "New Game", "Continue", "Settings", "End Game" }; Scene[] menuDest = new Scene[1]; menuDest[0] = new PlaygroundScene(0, 0, 320, 480, Content, graphics.GraphicsDevice, scenemanager); scenemanager.addScene(new MainMenu(0, 0, 320, 480, Content, graphics.GraphicsDevice, scenemanager, menuText, menuDest)); //add Menu screen here player = new VideoPlayer(); video = Content.Load<Video>("Video/Intro"); //player.Play(video); }
public void removeScene(Scene oldScene) { sceneStack.Remove(oldScene); if (sceneStack.Count == 0) { _currentScene = null; } else { _currentScene = (Scene)sceneStack[sceneStack.Count - 1]; } }
public void addScene(Scene newScene) { sceneStack.Add(newScene); _currentScene = (Scene)sceneStack[sceneStack.Count-1]; }