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 › launch interface for three sketches
Page Index Toggle Pages: 1
launch interface for three sketches (Read 960 times)
launch interface for three sketches
Apr 9th, 2007, 9:48pm
 
I want to be able to switch processing applets in full screen using a keystroke.  I tried open() and exit() but that does not werk. Also I cant use a browser cause im capuring video... can anyone help?
thanks
Re: launch interface for three sketches
Reply #1 - Apr 10th, 2007, 9:30am
 
there are several ways to do this ...

one would be to merge the sketches into one and have a switch state decide which "mode" the sketch currently is in. that would be the cleanest solution.

then there's open(), which you've tried. i'm sure it works, maybe you want to post your code, so we can see what's going wrong for you

another method could be to embed the sketch(es) into a plain java-app and have that switch between different sketches. some information is in PApplet. be sure that this way's gonna be a bumpy ride, because you have to leave the Processing trail and cross over to Java.

F
Re: launch interface for three sketches
Reply #2 - Apr 12th, 2007, 5:14pm
 
>>one would be to merge the sketches into one and have a switch state decide >>which "mode" the sketch currently is in. that would be the cleanest solution.

wow, works so well! thanks so much!
Re: launch interface for three sketches
Reply #3 - May 6th, 2007, 4:13pm
 
I was just looking for a similar solution for several of my students.

In Director days this was incredibly easy: a function called "playMovie" allowed you to switch from one animation to the next, the only dangerous thing was global variables. For concerts or visualist needs this is pretty essential stuff because it allows you to create different chapters, or sets, or call-it-what-you-will and create them quickly without having to worry about all the complexities of switch()ing between them within a main application. You could just jump whenever you wanted.

The other brilliant thing that Director did was that it could preload these animations so the entire process was extremely seemless. The advantage of a player+animation system. Amazingly, with some hacking you could switch between animations while the previous animation remained onscreen, allowing you to pick up where you left off, which was very cool for putting lots of pixeljunk on the screen. This last idea, though, is probably unworkable in Processing.

fjen wrote on Apr 10th, 2007, 9:30am:
another method could be to embed the sketch(es) into a plain java-app and have that switch between different sketches. some information is in PApplet. be sure that this way's gonna be a bumpy ride, because you have to leave the Processing trail and cross over to Java.


Since Processing uses sketch applets indeed this should be possible. I'll have to look into the above suggestion. By bumpy ride I assume you mean losing the window and opening a new one

...

As for playing inside of a browser, this is absolutely possible, even with video tracking. You just have to sign your applet. I have an applet (with sourcecode) that does this at the following address:

http://www.abstractmachine.net/thesis/diagrams.php?name=camera

You could do something similar and give permanent permission to each applet from within your browser. This is a little tedious and wonky, but doable.

It is less of a solution for me, because I'm on a Mac, and I haven't found a good full-screen hack for Safari. I tried a few a long time ago, but they always seemed to have problems. Maybe there's a better hack out there now.

And a browser switch might also be ugly as well, with a flash of white as the page loads. I don't know.

...

The best solution is having a swtich() function from within the Processing libraries that would allow you to load in new applets. This could be very powerful, especially given the rapid nature of development in Processing.
Page Index Toggle Pages: 1