You basically want to use the
Sprite:WFCanim:SetFrame() function
-- initialize global vars
SCREEN_BOTTOM = 0
SCREEN_TOP = 1
PALETTE_WFV = 0
BGTopText = Screen.LoadTextBG()
Screen.Initialize( SCREEN_TOP, BGTopText )
BGTopText:PrintXY( 0, 1, "Wifi Connection sprite test 1" )
BGTopText:PrintXY( 0, 4, "Press Select to exit." )
Sprite.LoadPalette( SCREEN_BOTTOM, PALETTE_WFV, "AllWifiCon.bmp.pal" )
WFCFrames = FrameStrip.Create( SCREEN_BOTTOM, 16, 16, "256" )
WFCFrames:LoadBin( "AllWifiCon.raw", 5 )
nCurrentFrame = 0
nCount = 0
WFCanim = Sprite.Create( WFCFrames, 0, PALETTE_WFV, 240, 176 )
while true do
-- set the sprite to a specified frame
WFCanim:SetFrame( WFCFrames, nCurrentFrame )
-- keep track of frame count, and limit it to be 0-19
nCount = math.mod( nCount + 1, 20 )
if ( nCount == 0 ) then
-- increment frame index every 20 frames
nCurrentFrame = nCurrentFrame + 1
end
-- limit frame index to 0-4
if ( nCurrentFrame > 4 ) then
nCurrentFrame = 0
end
-- exit loop when user press SELECT
if Pads.Select() then
break
end
Screen.WaitForVBL()
end
WFCanim:Free()
WFCFrames:FreeAll()
WFCFrames = nil
Enjoy!
Waruwaru