internal void LoadContent(ContentManager Content)
        {
            animationSequence = new CelAnimationSequence(Content.Load<Texture2D>("blackelmer_standing"), 74, 1 / 4f);

            celAnimationPlayer = new CelAnimationPlayer();
            celAnimationPlayer.Play(animationSequence);
        }
        /// <summary>
        /// Begins or continues playback of a CelAnimationSequence.
        /// </summary>
        public void Play(CelAnimationSequence CelAnimationSequence)
        {
            if (CelAnimationSequence == null)
                throw new Exception("CelAnimationPlayer.PlayAnimation received null CelAnimationSequence");

            // If this animation is already running, do not restart it...
            if (CelAnimationSequence != celAnimationSequence)
            {
                celAnimationSequence = CelAnimationSequence;
                celIndex = 0;
                celTimeElapsed = 0.0f;

                celSourceRectangle.X = 0;
                celSourceRectangle.Y = 0;
                celSourceRectangle.Width = celAnimationSequence.CelWidth;
                celSourceRectangle.Height = celAnimationSequence.CelHeight;
            }
        }
예제 #3
0
        internal void LoadContent(ContentManager Content)
        {
            idleSequence = new CelAnimationSequence(Content.Load<Texture2D>("blackelmer_standing"), 74, 1 / 4f);
            walkSequence = new CelAnimationSequence(Content.Load<Texture2D>("blackelmer_walking"), 68, 1 / 8f);
            jumpSequence = new CelAnimationSequence(Content.Load<Texture2D>("blackelmer_jumping2"), 85, 1 / 8f);

            celAnimationPlayer = new CelAnimationPlayer();
            celAnimationPlayer.Play(idleSequence);
        }