Check out this Korean blog post on the subject with more information on how to use TSprite.
Update: Download TSprite For Delphi XE5 Firemonkey w/ Mobile Draw Fix
A developer commented (see below) that the code had problems on mobile. I’ve updated the mobile demo and patched the TSprite component to fix the problem. Basically on mobile you have to call InvalidateRect() on the rectangle to get it to redraw. I also updated the mobile demo to load the data off of the form instead of having to include files in your mobile deployment.
Procedure TSprite.DrawFrame(Number: Integer);
begin
SetFrameSize(Number);
FFrameNumber := Number;
Width := FFrame.Width;
Height := FFrame.Height;
FFrame.Clear(clanull);
FFrame.Canvas.BeginScene;
FFrame.Canvas.DrawBitmap(FSpriteSheet,
RectF(FrameX, FrameY, FrameX + FFrame.Width, FrameY + FFrame.Height),
RectF(0, 0, FFrame.Width , FFrame.Height), 1);
FFrame.Canvas.EndScene;
{$IFDEF POSIX}
InvalidateRect(RectF(0, 0, FFrame.Width , FFrame.Height));
{$ENDIF}
if FFlippedX then FFrame.FlipHorizontal;
if FFlippedY then FFrame.FlipVertical;
Repaint;
end;
Update: Download the TSprite component and demos for Delphi XE6 Firemonkey.
The change I made to make it work under Delphi XE6 Firemonkey was to change it’s parent control from TControl to TRectangle. I don’t know if that is the right way to do it but it worked so I’m going with it.