1. NodeBox 1
    1. Homepage
    2. NodeBox 3Node-based app for generative design and data visualization
    3. NodeBox OpenGLHardware-accelerated cross-platform graphics library
    4. NodeBox 1Generate 2D visuals using Python code (Mac OS X only)
  2. Gallery
  3. Documentation
  4. Forum
  5. Blog

Changing speed in animation

Posted by T on Dec 03, 2008

Hello all,
Is there any way that I can change the speed of my animation when it is still playing, using the up/down arrow keys?

Thanks!


 
Posted by Josh Caswell on Dec 17, 2008

I can't say that this will not cause awkwardness, crashes, or other nasty things, but you can check in your draw() function whether there is a key pressed.

def draw():
	if keydown:
		if key == KEY_UP:
			inc_frame_rate()
		if key == KEY_DOWN:
			dec_frame_rate()
where you have defined functions inc_frame_rate() and dec_frame_rate() to do whatever you want. I have no idea whether NodeBox, or any other program into which you load your movie, will gracefully handle having its speed changed in the middle of an animation, or throw a temper tantrum. Good luck.