示例#1
0
        internal void LoadContent(ContentManager Content)
        {
            Texture2D spin = Content.Load <Texture2D>("coin");

            spinning           = new CelAnimationSequence(spin, 21, 1 / 8f);
            celAnimationPlayer = new CelAnimationPlayer();
        }
示例#2
0
        internal void LoadContent(ContentManager Content)
        {
            _texture = Content.Load <Texture2D>(_textureName);
            Texture2D brokenTexture = Content.Load <Texture2D>("Poof");

            brokenAnimationSequence = new CelAnimationSequence(brokenTexture, 16, 1 / 16f);
            celAnimationPlayer      = new CelAnimationPlayer();
        }
        /// <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;
            }
        }
示例#4
0
 internal void LoadContent(ContentManager Content)
 {
     cat          = Content.Load <Texture2D>("cat");
     catright     = Content.Load <Texture2D>("catright");
     walkSequence = new CelAnimationSequence(Content.Load <Texture2D>("catwalk"), 43, 1 / 8f);
 }