Re: Playing an image sequence in reverse
Status: Alpha
Brought to you by:
cwalther
|
From: James W. <jfc...@ya...> - 2009-09-28 20:22:58
|
Thanks!
However, I still got the same output when I used this, Pipmak tried to find "an_anim_-1" and so on.
Here's my new code:
CODE*****************************************************************
cubic { "dummy1024.png", "dummy.png","dummy.png", "dummy.png", "dummy.png", "dummy.png" }
local an_linkingBook = patch {face=1, x = 0, y = 0, image = "an_linkingBook/an_linkingBook_0.jpg" }
local animpos = 100
hotspotmap "hotspotmap.png"
hotspot {
onmousedown = function()
if animpos == 0 then
animpos = 100
else
pipmak.schedule(
0.04,
function()
animpos = math.mod(animpos - 1, 100)
an_linkingBook:setimage ("an_linkingBook/an_linkingBook_" .. animpos .. ".jpg")
return 0.04
end
)
end
end
}
CODE*****************************************************************
Does anyone see the problem? I sure can't.
Thanks,
James
--- On Sun, 9/27/09, Urs Holzer <ur...@an...> wrote:
From: Urs Holzer <ur...@an...>
Subject: Re: Playing an image sequence in reverse
To: pip...@li...
Date: Sunday, September 27, 2009, 5:59 AM
Hi
> I'm trying to run a JPEG image sequence in reverse order, but am
> running into problems:
>
> Code:
> [...]
> animpos = math.mod(animpos - 1, 101)
> [...]
I guess this line is the problem. According to the Lua 5.0 reference,
math.mod just uses the mod operator from ANSI C. If I remember
correctly, ANSI C does define the result of it on a negative number as
implementation specific, so, depending on the plattform the software
runs on, math.mod(-1, 101) could be -1 or 100.
By replacing the above line with
if animpos < 0 then animpos = 100 end
should give what you want.
However, because of laziness, I have not tested it!
Greetings
Urs
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Pipmak-Users mailing list
Pip...@li...
news://news.gmane.org/gmane.games.devel.pipmak.user
https://lists.sourceforge.net/lists/listinfo/pipmak-users
|