예제 #1
0
파일: Game1.cs 프로젝트: Telos8840/TestGame
 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
 }
예제 #2
0
파일: MainMenu.cs 프로젝트: Telos8840/CS461
 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();
 }
예제 #3
0
파일: Game1.cs 프로젝트: Commander147/CS461
 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);
 }
예제 #4
0
 public void removeScene(Scene oldScene)
 {
     sceneStack.Remove(oldScene);
     if (sceneStack.Count == 0)
     {
         _currentScene = null;
     }
     else
     {
         _currentScene = (Scene)sceneStack[sceneStack.Count - 1];
     }
 }
예제 #5
0
 public void addScene(Scene newScene)
 {
     sceneStack.Add(newScene);
     _currentScene = (Scene)sceneStack[sceneStack.Count-1];
 }