Ejemplo n.º 1
0
        public void splitWidth()
        {
            Rectangle rect = new Rectangle {
                X = 10, Y = 11, Width = 12, Height = 13
            };
            ISprite split = sprite.split(rect);

            Assert.AreEqual(12, split.getWidth());
        }
Ejemplo n.º 2
0
        public AnimatedSprite createAnimatedSprite(ISprite baseImage, int frames,
                                                   int delay, bool loop)
        {
            Debug.Assert(baseImage != null);
            Debug.Assert(frames > 0);

            int frameWidth = baseImage.getWidth() / frames;

            ISprite[] animation = new ISprite[frames];
            for (int i = 0; i < frames; i++)
            {
                animation[i] = baseImage.split(i * frameWidth, 0, frameWidth,
                                               baseImage.getHeight());
            }

            return(new AnimatedSprite(animation, delay, loop));
        }
Ejemplo n.º 3
0
 public void spriteWidth()
 {
     Assert.AreEqual(spriteSize, sprite.getWidth());
 }
Ejemplo n.º 4
0
        public void splitWidth()
        {
            ISprite split = sprite.split(10, 11, 12, 13);

            Assert.AreEqual(12, split.getWidth());
        }