Ejemplo n.º 1
0
        public override void LoadContent()
        {
            input = new Input();

            dfp20 = ScreenManager.Content.Load <SpriteFont>("Font/dfp20");

            donIdleSheet   = ScreenManager.Content.Load <Texture2D>("Texture/Don/Anim/SongSelect/idle");
            bgMask         = ScreenManager.Content.Load <Texture2D>("Texture/SongSelect/bgMask");
            timerBg        = ScreenManager.Content.Load <Texture2D>("Texture/SongSelect/timer");
            selectSongText = ScreenManager.Content.Load <Texture2D>("Texture/SongSelect/selectText");

            menu = new Menu(ScreenManager.Content, ScreenManager.SpriteBatch);
            menu.LoadContent();

            animator = new SpriteAnimator(ScreenManager.SpriteBatch);
            donIdle  = new SpriteAnimation(donIdleSheet, new Vector2(291, 291), new Vector2(10, 3), 30, 1000f / ((30 * 116) / 60), true);

            animator.Add("idle", donIdle);
            animator.Switch("idle");

            idleLoop       = new WaveFileReader("Content/Music/SongSelect/idle.wav");
            idleLoopStream = new LoopStream(idleLoop, 254437);

            music = new Jukebox();
            music.Play(idleLoopStream);

            sfx = new Jukebox();

            kat = ScreenManager.Content.Load <SoundEffect>("kat");

            base.LoadContent();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Add an animation
 /// </summary>
 /// <param name="name">Animation name</param>
 /// <param name="indexes">Array of index that represent images</param>
 /// <param name="frameRate">Framerate for this animation</param>
 /// <param name="reversed">Reverse or not the animation</param>
 public void AddAnimation(string name, int[] indexes, int frameRate, bool reversed)
 {
     _animator.Add(name, indexes, frameRate, reversed);
     _sourceRectangle = _animator.Animations[name].Rectangle[0];
 }