public AnimatedSprite(World world, Texture2D texture, Vector2 position, Vector2 size, Single rotation, Color color, Point maxFrames, Point frameSize, SpriteSheetDirection direction, bool loop)
            : base(world, texture, position, size, rotation, color)
        {
            this.maxFrames = maxFrames;
            this.frameSize = frameSize;
            this.direction = direction;
            this.Loop = loop;

            if (Direction == SpriteSheetDirection.LeftToRight)
                this.currentFrame = Point.Zero;
            else if (Direction == SpriteSheetDirection.RightToLeft)
                this.currentFrame = new Point(maxFrames.X, 0);
            else
                throw new ArgumentOutOfRangeException("direction", "Only left-to-right and right-to-left are supported at this time");
        }
Exemple #2
0
        public AnimatedSprite(World world, Texture2D texture, Vector2 position, Vector2 size, Single rotation, Color color, Point maxFrames, Point frameSize, SpriteSheetDirection direction, bool loop)
            : base(world, texture, position, size, rotation, color)
        {
            this.maxFrames = maxFrames;
            this.frameSize = frameSize;
            this.direction = direction;
            this.Loop = loop;

            this.currentFrame = FirstFrame;
        }
Exemple #3
0
 public AnimatedSprite(World world, Texture2D texture, Vector2 position, Vector2 size, Single rotation, Point maxFrames, Point frameSize, SpriteSheetDirection direction, bool loop)
     : this(world, texture, position, size, rotation, Color.White, maxFrames, frameSize, direction, loop)
 { }