Loadanim problem with iPod

Previous topic - Next topic

Crivens

Ok so I've got an image I use with LOADANIM (see attached youwin.png) that is basically an animated "You win". It works perfectly in Windows, and on a 3GS iPhone (4.2.1), but a 2nd gen iPod Touch (4.1) shows the animation incorrectly. Everything else is identical between the 3GS and the iPod. The animgated image looks a little offset. I've included the main file, a screenshot from the 3GS, and a screenshot from the iPod.

The loading code I use is this:-
Code (glbasic) Select
GLOBAL youwinid=100
GLOBAL youwinwidth=220
GLOBAL youwinheight=120
LOADANIM "Media/youwin.png",youwinid,youwinwidth,youwinheight


and the drawing code is this:-
Code (glbasic) Select
SUB youwon:
ALPHAMODE 1
DRAWANIM youwinid,frameno,gamescreenx/2-(youwinwidth/2),gamescreeny/2-(youwinheight)
ALPHAMODE 0
SETFONT 1
LOCAL scorestr$="Score:"+score
PRINT scorestr$,gamescreenx/2-(LEN(scorestr$,kern)/2),youwinheight+(gamescreeny/2)-(fonty/2)-fonty,kern
IF showcontinue=1
scorestr$="Continue"
PRINT scorestr$,gamescreenx/2-(LEN(scorestr$,kern)/2),screeny-fonty,kern
ENDIF
SETFONT 0
scorestr$="Moves:"+moves
PRINT scorestr$,gamescreenx/2-(LEN(scorestr$,kern)/2),youwinheight+(gamescreeny/2)-(fonty/2),kern
SETFONT 3
scorestr$="High:"+oldhigh
IF score>oldhigh THEN scorestr$="Old "+scorestr$
PRINT scorestr$,gamescreenx/2-(LEN(scorestr$,kern)/2),bottombar,kern2
IF GETTIMERALL()-lasttimer>100
INC frameno
IF frameno>5 THEN frameno=0
lasttimer=GETTIMERALL()
ENDIF
ENDSUB


Cheers

[attachment deleted by admin]
Current fave quote: Cause you like musicians and I like people with boobs.

Ian Price

There's two possible reasons that this might be failing (that I can think of off the top of my head) - memory and/or texture limits.

IIRC the maximum size of a texture (image) on the iPhone is 1024xXXX - your image is 1320xXXX. Might be too long?

It might be worth trying to put the first 3 images on top of the second three images (of the six) so you have 3x2 images rather than 6x1 - if this fails, then maybe it's a memory issue?

Dunno.
I came. I saw. I played.

Crivens

Ah yeah that makes sense. Must remember that in future! It's only a placeholder anyway so no harm done. Out of interest do you know if GLB does animated gifs or any other animation such as avi?

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Crivens

Oh yeah but note if 1024 is max image size on iPhone then how come the 3GS example works fine (like the PC)? I'm betting you are correct but does this mean the 3GS has a bigger limit than the iPod touch 2g?

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Ian Price

I did say "might" (a few times) be the reasons. I don't know, they are just theories. Only you can tell, as I don't have the tech to test (and I was at work at the time anyway).

Why did my app work fine on my iPod, but have no sound on anybody else's? It would appear that the tech is not equal...
I came. I saw. I played.