We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › best way to wrap sketches together
Page Index Toggle Pages: 1
best way to wrap sketches together? (Read 1659 times)
best way to wrap sketches together?
May 24th, 2005, 4:38am
 
Hi

I need to find a way to make a series of sketches run one after another in a smooth way; no dos batch windows or anything like it - just a sketch, then another, then another.
Each sketch can call the next after a time interval;

Is there a way to do this?
Re: best way to wrap sketches together?
Reply #1 - May 24th, 2005, 11:13am
 
I've written a timeline that gives this kind of functionality. It was inspired by TomC talking about interfaces and abstract classes.

Essentially each sketch can be dropped into a timeline as a display element and then viewed with or without transistional cross-fades, or overlaps etc.

You can also superimpose any number of timelines and have dedicated audio/ visual channels, or mix them up.

Let me know if this sounds of any use to you.
Re: best way to wrap sketches together?
Reply #2 - May 24th, 2005, 9:11pm
 
hey, sounds fantastic! Is it available? Can I try it?

Thanks!
Re: best way to wrap sketches together?
Reply #3 - May 24th, 2005, 10:34pm
 
No probs,

I'll upload it and either post a link here, or just paste in the code. It's not very long.

I just hope it's useful to you.

Bear with me...
Re: best way to wrap sketches together?
Reply #4 - May 25th, 2005, 10:29am
 
Here's a link to a basic applet using the timeline. I've stripped out my own controller and have just cludged it to read off the mouseX position.

I'm increasing the functionality of this and will include documentation, but I think you'll find it's fairly self-explanatory.

With each element you add is a constructor and display(); method, similar to the setup and draw methods of the PApplet class. (You may find it useful to implement some background tasks, if you want offscreen updating)

http://www.mark-hill.co.uk/p5/timelines/

Let me know if you have any trouble, or find any room for improvements.

Thanks to TomC for the suggestion elsewhere on this board and his code some of which remains albeit in an altered form.

Mark.

P.S If you find my version stumbles along a bit, it's probably due to the numerous tint calls I'm using (especially when cross-fading and overlaping timelines). Also when including images beware of relying on the image(); methods scale function, as this is really going to slow you down. I'd drop in another constructor for TimeLine_DrawImage  that deals with your images in a more appropriate manner.

Oh! I should mention when adding your own TimelineElements that the first 2 arguments describe the duration and are essential!
Re: best way to wrap sketches together?
Reply #5 - May 25th, 2005, 4:39pm
 
great Mark, thanks a lot. I'll try it.

My problem though is that I need to wrap very different sketches together; some use JAVA2D, some use  OPEN_GL;
Do you know if it's possible to change the sketch mode along the way?
Re: best way to wrap sketches together?
Reply #6 - May 25th, 2005, 5:12pm
 
lunetta wrote on May 25th, 2005, 4:39pm:
Do you know if it's possible to change the sketch mode along the way

it's not, unfortunately. it may work in some circumstances, but it can't be done and won't be supported in the future:
http://processing.org/discourse/yabb_beta/YaBB.cgi?num=1117012121

i've had luck with a processing demo that is one base java application that takes over the whole screen, then launches another applet that takes over the whole screen. it makes the thing seem like the same app and as if they're seamless, doesn't involve having them all running at the same time.
Re: best way to wrap sketches together?
Reply #7 - May 25th, 2005, 5:24pm
 
What about img being a PGraphics type. Maybe this instead of PImage will give access to the different modes, or perhaps (g) can be cast depending on where you're at in the timeline? I'll look into it.
Re: best way to wrap sketches together?
Reply #8 - May 25th, 2005, 6:11pm
 
fry wrote on May 25th, 2005, 5:12pm:
i've had luck with a processing demo that is one base java application that takes over the whole screen, then launches another applet that takes over the whole screen.


yep, that's all I need. Is it hard to call a fullscreen sketch from another fullscreen sketch
Page Index Toggle Pages: 1