|
View:
New views
9 Messages
—
Rating Filter:
Alert me
|
|
|
Playing an image sequence in reverse
------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Pipmak-Users mailing list Pipmak-Users@... news://news.gmane.org/gmane.games.devel.pipmak.user https://lists.sourceforge.net/lists/listinfo/pipmak-users |
|
|
|
Re: Playing an image sequence in reverseHi
> 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 Pipmak-Users@... news://news.gmane.org/gmane.games.devel.pipmak.user https://lists.sourceforge.net/lists/listinfo/pipmak-users |
|
|
|
Re: Playing an image sequence in reverse
------------------------------------------------------------------------------ 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 Pipmak-Users@... news://news.gmane.org/gmane.games.devel.pipmak.user https://lists.sourceforge.net/lists/listinfo/pipmak-users |
|
|
|
Re: Playing an image sequence in reverseJames Wilson wrote:
> However, I still got the same output when I used this, Pipmak tried to > find "an_anim_-1" and so on. pipmak.schedule runs the function you give it as an argument after the given time. So, what is run again and again is only the function() below, not the whole code of onmousedown of the hotspot. So the if..then I gave you in my previous post has to be placed in the function() below: > pipmak.schedule( > 0.04, > function() > animpos = math.mod(animpos - 1, 100) > an_linkingBook:setimage ("an_linkingBook/an_linkingBook_" .. animpos .. > ".jpg") return 0.04 > end > ) Just change this to pipmak.schedule( 0.04, function() if animpos < 0 then animpos = 100 end an_linkingBook:setimage ("an_linkingBook/an_linkingBook_" .. animpos ..".jpg") return 0.04 end ) or similar. Now it loops automatically. I hope this is what you want. Then you also don't need the if..then..else in the onmousedown function. 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 Pipmak-Users@... news://news.gmane.org/gmane.games.devel.pipmak.user https://lists.sourceforge.net/lists/listinfo/pipmak-users |
|
|
|
Re: Playing an image sequence in reverse
------------------------------------------------------------------------------ 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 Pipmak-Users@... news://news.gmane.org/gmane.games.devel.pipmak.user https://lists.sourceforge.net/lists/listinfo/pipmak-users |
|
|
|
Re: Playing an image sequence in reverseJames Wilson wrote:
> Thanks, I think this last little problem is my fault: > I click on the hotspot and nothing happens. I think it's because I closed > "hotspot" incorrectly. What do you think? Sorry to drag this out. Sorry, this is my fault. The line if animpos < 0 then animpos = 100 end only makes sure that animpos gets back to 100 once it reaches -1. I forgot to insert a line that actually decreases animpos by 1. So this should work now: hotspot { onmousedown = function() pipmak.schedule( 0.04, function() animpos = animpos - 1 if animpos < 0 then animpos = 100 end an_linkingBook:setimage ("an_linkingBook/an_linkingBook_" .. animpos ..".jpg") return 0.04 end ) end } ------------------------------------------------------------------------------ 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 Pipmak-Users@... news://news.gmane.org/gmane.games.devel.pipmak.user https://lists.sourceforge.net/lists/listinfo/pipmak-users |
|
|
|
Re: Playing an image sequence in reverse
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ------------------------------------------------------------------------------ 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 Pipmak-Users@... news://news.gmane.org/gmane.games.devel.pipmak.user https://lists.sourceforge.net/lists/listinfo/pipmak-users |
|
|
|
Re: Playing an image sequence in reverseJames Wilson wrote:
> Thanks! That worked perfectly. Thanks also for being patient with me. Good. By the way, if you activate the animation like that, then you have to make sure that it is not activated twice. Try clicking multiple times at the image to see what happens. If my guess is correct, the sequence will run twice as fast (if your computer can keep up with the pace) after you click on it the second time. In other words: You have to make sure that the animation can not be activated again while it is already running. However, if I remember correctly, the animation in linking books in Myst starts immediately after opening the book. In other words, the animation is activated automatically and not by the user. If the same is true for your linking books, you don't have the problem I described above. And anyway, don't hesitate to ask more questions. We are happy to answer them. 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 Pipmak-Users@... news://news.gmane.org/gmane.games.devel.pipmak.user https://lists.sourceforge.net/lists/listinfo/pipmak-users |
|
|
|
|
Yes, this was only a test for general animation. The actual applied use is to make it loop, even when the ending and beginning do not match. E.g., I'd start the animation going forward, then backwards, and so on. Handy for things you don't have much control over when animating. So I just slapped together a test project, using renders form another project I'm involved in, Ages of Ilathid.
Thanks again,
|
| Free embeddable forum powered by Nabble | Forum Help |