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()); }
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)); }
public void spriteWidth() { Assert.AreEqual(spriteSize, sprite.getWidth()); }
public void splitWidth() { ISprite split = sprite.split(10, 11, 12, 13); Assert.AreEqual(12, split.getWidth()); }