@MissJoJo
Quote: "Here's some cool functions that I use when I change screen's, call backout([backroundimgid]) then backin([imgig]) when You load the screens.
function backout(sid)
if GetSpriteExists(sid)
frames = 8
for k = 1 to frames
x = GetSpriteX(sid)
y = GetSpriteY(sid)
w = GetSpriteWidth(sid)
h = GetSpriteHeight(sid)
a = GetSpriteColorAlpha(sid)
an = GetSpriteAngle(sid)
SetSpriteSize(sid,w-1,h-1)
SetSpriteAngle(sid,an+10)
SetSpriteColorAlpha(sid,a-25)
sync()
next
DeleteSprite(sid)
endif
endfunction
function backin(sid)
if GetSpriteExists(sid)
frames = 9
SetSpriteSize(sid,91,91)
SetSpriteAngle(sid,-90)
SetSpriteColorAlpha(sid,30)
for k = 1 to frames
x = GetSpriteX(sid)
y = GetSpriteY(sid)
w = GetSpriteWidth(sid)
h = GetSpriteHeight(sid)
a = GetSpriteColorAlpha(sid)
an = GetSpriteAngle(sid)
SetSpriteSize(sid,w+1,h+1)
SetSpriteAngle(sid,an+10)
SetSpriteColorAlpha(sid,a+25)
sync()
next
SetSpriteSize(sid,100,100)
SetSpriteAngle(sid,0)
SetSpriteColorAlpha(sid,255)
endif
endfunction
"
I assume that's AppGameKit with which I'm no familiar so correct me if I'm wrong but wouldn't this be better:
function backout(sid)
if GetSpriteExists(sid)
x = GetSpriteX(sid)
y = GetSpriteY(sid)
w = GetSpriteWidth(sid)
h = GetSpriteHeight(sid)
a = GetSpriteColorAlpha(sid)
an = GetSpriteAngle(sid)
frames = 8
for k = 1 to frames
w = w - 1
h = h - 1
an = an + 10
a = a - 25
SetSpriteSize(sid,w,h)
SetSpriteAngle(sid,an)
SetSpriteColorAlpha(sid,a)
sync()
next
DeleteSprite(sid)
endif
endfunction
function backin(sid)
if GetSpriteExists(sid)
SetSpriteSize(sid,91,91)
SetSpriteAngle(sid,-90)
SetSpriteColorAlpha(sid,30)
x = GetSpriteX(sid)
y = GetSpriteY(sid)
w = GetSpriteWidth(sid)
h = GetSpriteHeight(sid)
a = GetSpriteColorAlpha(sid)
an = GetSpriteAngle(sid)
frames = 9
for k = 1 to frames
w = w + 1
h = h + 1
an = an + 10
a = a + 25
SetSpriteSize(sid,w,h)
SetSpriteAngle(sid,an)
SetSpriteColorAlpha(sid,a)
sync()
next
SetSpriteSize(sid,100,100)
SetSpriteAngle(sid,0)
SetSpriteColorAlpha(sid,255)
endif
endfunction
That way you don't make all those GET calls each iteration and this optimizes the code so it'll save precious resources, esp on the mobile platform.
Like I say, dunno about AppGameKit so maybe there's a reason to do it your way, but I just thought I'd put it out there in case it's of use.
"Quotes in signatures are just stupid, especially if you're quoting yourself" ~ me