Beispiel #1
0
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            SpriteBatch = new SpriteBatch(GraphicsDevice);
            GameData    = new GamePersistance <GameData>(this);
            Pixel       = new Texture2D(GraphicsDevice, 1, 1, false, SurfaceFormat.Color);
            Pixel.SetData(new[] { Color.White });
            Textures.LoadContent(Content);
            Font = new FontTexture(Content.Load <Texture2D>(@"Images\EditSysLarge.png"), 58, 8, -10, new[]
            {
                26, 22, 36, 36, 50, 47, 40, 21, 28, 28, 29, 33, 26, 40, 22, 47,
                47, 33, 47, 47, 47, 47, 47, 47, 47, 47, 26, 26, 51, 40, 46, 47,
                47, 47, 47, 47, 47, 47, 47, 47, 47, 26, 47, 47, 47, 47, 47, 47,
                47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 29, 47, 29, 33, 47,
                26, 31, 33, 30, 33, 32, 28, 33, 31, 22, 26, 32, 21, 40, 31, 24,
                33, 33, 27, 29, 28, 31, 33, 40, 32, 33, 31, 33, 21, 33, 33, 31
            });
            Mouse          = new MouseInput();
            IsMouseVisible = false;

            Touch         = new TouchInput();
            UnifiedInput  = new UnifiedInput(this);
            KeyboardInput = new KeyboardInput(this);
            UnifiedInput.TapListeners.Add(Tap);
            Branding.BackgroundColor = Color.Black;
            Audio.Play(Cues.Music01, AudioChannels.Music, true);
            _currentComponent = new Intro(this, null);
        }
Beispiel #2
0
 protected override void Initialize()
 {
     _taps          = new List <Vector2>();
     GameData       = new GamePersistance <GameData>(this);
     Audio          = new AudioFx(this);
     _currentTarget = new RenderTarget2D(Graphics.GraphicsDevice, Graphics.PreferredBackBufferWidth,
                                         Graphics.PreferredBackBufferHeight, false,
                                         SurfaceFormat.Color,
                                         DepthFormat.Depth24,
                                         0,
                                         RenderTargetUsage.PreserveContents);
     _previousTarget = new RenderTarget2D(Graphics.GraphicsDevice, Graphics.PreferredBackBufferWidth,
                                          Graphics.PreferredBackBufferHeight, false,
                                          SurfaceFormat.Color,
                                          DepthFormat.Depth24,
                                          0,
                                          RenderTargetUsage.PreserveContents);
     _backgroundParticles = new List <BackgroundParticle>();
     for (var i = 0; i < 100; i++)
     {
         var v = new Vector2(Random.Next((int)Width), Random.Next((int)Height));
         _backgroundParticles.Add(BackgroundParticle.CreateParticle(v));  //Dual Color Effect
         _backgroundParticles.Add(BackgroundParticle.CreateParticle(v));
     }
     _currentComponent = this;
     FadeX1            = 1f;
     FadeX2            = 1f;
     _fade1Xin         = false;
     _fade2Xin         = false;
     base.Initialize();
 }