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.
Page Index Toggle Pages: 1
call sketch in the same display (Read 754 times)
call sketch in the same display
Jul 24th, 2009, 11:07am
 
hi
i am a beginner with processing. now i would like to run a sketch for about 30 seconds an then another sketch should start running in the same display for another 30 seconds and so on. is there any possiblility to this?
thanks for your help.
cheers goldfish
Re: call sketch in the same display
Reply #1 - Jul 24th, 2009, 5:42pm
 
yes, there is!

u should reform every one of the sketches to classes and call each class every time needed. U can add a counter into draw and add 1 to the counter every time draw plays so if frameRate = 30 then draw would play 30 times / sec so counter after 30 sec would be 30 x 30. Then u should write somethink like this:

if (counter > 900) {
if (counter < 1800) {

call sketch 1 }}

if (counter > 1800) {
if (counter < 2700) {

call sketch 2 }}

and so on, ask for further details if it wasnt clear enought
Re: call sketch in the same display
Reply #2 - Jul 25th, 2009, 9:00am
 
hi
thanks for your input. i tried to programm a counter. it works. but is it not possible to call an external sketch without making a class of it? the problem with the classes is for me as a beginner quite complicated to understand. where i have to write what and how... so i would need some more help if there ist the only way over classes.
what i really want to do is, let a skript running, which uses a camera (and this is quite complex and i think not very easy to chang into a class), and then after a while, i would like to load another script also using the camera. the idea is a projection that should not be boring...
thanks for help.
cheers goldfish
Page Index Toggle Pages: 1