How to use animation (nextFrame) when key pressed?

How to use animation (nextFrame) when key pressed?

Postby Pixero » Mon Jun 24, 2019 8:01 am

Is there a simple example of how to use animation (nextFrame) for continous key pressed action?
0
User avatar
Pixero 
 

Re: How to use animation (nextFrame) when key pressed?

Postby fredo6 » Tue Jun 25, 2019 5:37 pm

Pixero wrote: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.
0
User avatar
fredo6 
PluginStore Author
PluginStore Author
 

Re: How to use animation (nextFrame) when key pressed?

Postby Pixero » Tue Jun 25, 2019 7:55 pm

Thanks. Ill try that.
0
User avatar
Pixero 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Developers' Forum

Who is online

Users browsing this forum: abhipanchal09 and 6 guests

Visit our sponsors: