Inheritance: SFML.Graphics.Sprite
        public void Draw(BatchedSprite sprite, int depth = 0)
        {
            if (!drawing)
            {
                throw new Exception("Begin() must be called first");
            }

            sprites.Add(Tuple.Create(depth, sprite));
        }
Exemple #2
0
        public AnimatedSprite(Texture texture, int frameWidth, int frameHeight, float frameTime)
        {
            this.frameWidth  = frameWidth;
            this.frameHeight = frameHeight;

            Sprite      = new BatchedSprite(texture);
            totalFrames = (int)(texture.Size.X / frameWidth) - 1;
            elapsedTime = 0;

            FrameTime    = frameTime;
            CurrentFrame = 0;
        }
        public AnimatedSprite(Texture texture, int frameWidth, int frameHeight, float frameTime)
        {
            this.frameWidth = frameWidth;
            this.frameHeight = frameHeight;

            Sprite = new BatchedSprite(texture);
            totalFrames = (int)(texture.Size.X / frameWidth) - 1;
            elapsedTime = 0;

            FrameTime = frameTime;
            CurrentFrame = 0;
        }
        public void Draw(BatchedSprite sprite, int depth = 0)
        {
            if (!drawing) throw new Exception("Begin() must be called first");

            sprites.Add(Tuple.Create(depth, sprite));
        }