How to use animation (nextFrame) when key pressed?
-
Is there a simple example of how to use animation (nextFrame) for continous key pressed action?
-
@pixero said:
Is there a simple example of how to use animation (nextFrame) for continous key pressed action?
You need to use a timer and stop it when the key is released. Possibly, you can increment the change rate by counting the timer hits to give some kind of acceleration is the arrow down are maintained for long. All this works very well and I use this approach in some of my plugins (ThruPaint for instance)..
Note that you cannot rely on the repeat feature of Sketchup Tool onKeyDown() callback, because it does not work reliably.
-
Thanks. Ill try that.
Advertisement