I am using AppGameKit 2.0.11 with AGK2 player build Jan26, 2015, and I still have an issue with creating sprite animations. I had asked about this earlier and was told there are no constraints except for the amount of available memory. My device has 1GB of RAM and over 20GB storage available.
I can only get 2 animated sprites created. The android device crashes as the 3rd one is loading. I do not get an error (that I can see), AGK2 player merely goes away.
I can present the code, but not the images. And that is where the issue lies when asking for advice. Everyone is going to use images I am not using and thus will say everything works for them. So whomever would like to assist, you could create dumby images. I will give the specs on the images so they are the same size and resolution.
As I load the images I am also determining the size and adding in order to know the total size of the images.
So, the test code shows (while running on the Android device) that around the 50th frame of animation 8 is where it will crash.
Attached is a text file of the image parameters.
rem
rem AGK Application
rem
GLOBAL screenWidth as FLOAT=1280.0
GLOBAL screenHeight as FLOAT=720.0
SetVirtualResolution(screenWidth,screenHeight)
TYPE _return
INT1 AS INTEGER
INT2 AS INTEGER
INT3 AS INTEGER
INT4 AS INTEGER
STR1 AS STRING
STR2 AS STRING
STR3 AS STRING
STR4 AS STRING
FLT1 AS FLOAT
FLT2 AS FLOAT
FLT3 AS FLOAT
FLT4 AS FLOAT
CA1 AS clickArea
ENDTYPE
TYPE clickArea
_Left as FLOAT
_Upper as FLOAT
_Right as FLOAT
_Lower as FLOAT
ENDTYPE
numAnimations AS INTEGER
numAnimations=10
DIM anim[numAnimations] AS INTEGER
DIM animRev[numAnimations] AS INTEGER
DIM freezeFrame[numAnimations] AS STRING
DIM sprAniFolder$[numAnimations]
DIM sprAniPrefix$[numAnimations]
RR AS _return
for a=1 to 40
CreateText(a,"")
SetTextSize(a,15)
SetTextColor(a,0,255,255,255)
SetTextPosition(a,1,a*15)
SetTextDepth(a,0)
next a
INITsprAniImage$="000.jpg"
sprAniFolder$[0]="table_halved"
sprAniFolder$[1]="table_together"
sprAniFolder$[8]="LAB_WakeUp"
sprAniPrefix$[0]=""
sprAniPrefix$[1]=""
sprAniPrefix$[8]=""
INITsprAniImage$="000.jpg"
RR=CREATE_ANIMATION(sprAniFolder$[0],0,INITsprAniImage$,sprAniPrefix$[0])
SetTextString(10,"anim0= "+STR(RR.INT2))
RR=CREATE_ANIMATION(sprAniFolder$[1],1,INITsprAniImage$,sprAniPrefix$[1])
SetTextString(11,"anim1= "+STR(RR.INT2))
RR=CREATE_ANIMATION(sprAniFolder$[8],8,INITsprAniImage$,sprAniPrefix$[8])
SetTextString(12,"anim8= "+STR(RR.INT2))
WHILE GetPointerPressed()=0
SYNC()
ENDWHILE
END
FUNCTION CREATE_ANIMATION(sprAniFolder AS STRING,aniSpriteNum AS INTEGER,INITsprAniImage AS STRING,imgPrefix AS STRING)
fSize AS INTEGER
imgFrame AS INTEGER
RR AS _return
SetFolder("")
SetFolder("media/ani/"+sprAniFolder)
initAnimImg=LoadImage(imgPrefix+INITsprAniImage)
anim[aniSpriteNum] = CreateSprite(initAnimImg)
SetSpriteVisible(anim[aniSpriteNum],0)
fSize=0
fn$=""
fn$=GetFirstFile()
count=0
while fn$<>""
Inc count
fn$=GetNextFile()
endwhile
for i=0 to count-1
if i<10 then frame$="00"+STR(i)
if i>9 AND i<100 then frame$="0"+STR(i)
if i>99 then frame$=STR(i)
imgFrame=LoadImage(imgPrefix+frame$+".jpg")
OpenToRead (1,imgPrefix+frame$+".jpg")
fSize=fSize+GetFileSize(1)
CloseFile(1)
SetTextString(30,"LOADING animation: "+STR(aniSpriteNum)+"> "+imgPrefix+frame$+".jpg")
SetTextString(31,"total size: "+STR(fSize))
AddSpriteAnimationFrame(anim[aniSpriteNum],imgFrame)
SYNC()
next i
RR.INT1=initAnimImg
RR.STR1=freezeFrame[aniSpriteNum]
RR.INT2=fSize
SetTextString(30,"")
SetTextString(31,"")
ENDFUNCTION RR
home.wavecable.com/~mindsclay