Exemplo n.º 1
0
 public SlideShowState()
 {
     this.skippable = true;
     this.timePerSlide = 300;
     Timer slideTimer = new Timer(timePerSlide);
     slideTimer.Elapsed += OnTimedEvent;
     config = Utils.loadConfig();
 }
Exemplo n.º 2
0
 public SlideShowState(Queue<Texture2D> s, Boolean skip, int duration)
 {
     this.slides = s;
     this.skippable = skip;
     this.timePerSlide = duration;
     if(duration > 0)
     {
         Timer slideTimer = new Timer(timePerSlide);
         slideTimer.Elapsed += OnTimedEvent;
     }
     config = Utils.loadConfig();
 }
Exemplo n.º 3
0
        /// <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);

            //Load content.
            //Push initial loading screen state onto game state stack.
            SlideShowState loadSeq = new SlideShowState(new Queue<Texture2D>(), false, -1);
            loadSeq.addSlide(this.Content.Load<Texture2D>("Screens/other"));
            stateManager.push(loadSeq);

           config = Utils.loadConfig();

            this.IsFixedTimeStep = true;
            this.graphics.SynchronizeWithVerticalRetrace = true;
            this.TargetElapsedTime = new System.TimeSpan(0, 0, 0, 0, 1000 / config.fps);

            switch (config.resolutionLevel)
            {
                case 1:
                    graphics.PreferredBackBufferWidth = 1600;  // set this value to the desired width of your window
                    graphics.PreferredBackBufferHeight = 1200;   // set this value to the desired height of your window
                    break;
                case 2:
                    graphics.PreferredBackBufferWidth = 1024;  // set this value to the desired width of your window
                    graphics.PreferredBackBufferHeight = 768;   // set this value to the desired height of your window
                    break;
                default:
                    graphics.PreferredBackBufferWidth = 800;  // set this value to the desired width of your window
                    graphics.PreferredBackBufferHeight = 600;   // set this value to the desired height of your window
                    break;
            }

            graphics.ApplyChanges();
            this.Window.Position = new Point((System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width - graphics.PreferredBackBufferWidth) / 2, 0);

            font = Content.Load<SpriteFont>("Fonts/Orator");

            //After loading content, push Title Screen State.
            //stateManager.pop();
            //stateManager.push(new TitleState());
        }