[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4668: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4670: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4671: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4672: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
XWidgetSoft Forum • View topic - Shake Animation TRICK???

XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently April 18th, 2024, 9:13 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 28 posts ] 
Author Message
 Post subject: Shake Animation TRICK???
PostPosted: November 5th, 2013, 4:08 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Check this out guys! Cool? 8-)
(the design is not completed yet that's why the top of the wires look like this)

Everyone knows this pendulum "clock".
Is there a trick so I can add 1 second delay between the shake animations, or a way so the movement will be as the real one??? :roll:
(The balls move parallelly)
Tony added the delay function but is only for switch animations...


Attachments:
ok.jpg
ok.jpg [ 94.91 KiB | Viewed 6512 times ]

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/
Top
 Profile  
 
PostPosted: November 6th, 2013, 4:17 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
I found this:

var img = paper.image("image.png", 10, 10, 80, 80);
(function swingRight(){
img.animate({'rotation': 30}, 1000, '<>', function swingLeft(){
img.animate({'rotation': -30}, 1000, '<>', swingRight);
});
}());

how can this be applied on Designer...?

An image can be animated (shake-pendulum animation) using a script?

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: November 6th, 2013, 6:04 am 
Offline
User avatar

Joined: June 10th, 2012, 6:04 am
Posts: 5
you can also write this between every animate starts:
sleep(100);
It means that the next line of cade will start in 100 millisecond after the previous line of code of cade .


Top
 Profile  
 
PostPosted: November 6th, 2013, 7:45 am 
Offline
User avatar

Joined: July 9th, 2012, 1:14 pm
Posts: 112
There is a nice widget by xwidgetsoft with "shaking script" http://url9.de/OBr.
Maybe it's helpful.


Top
 Profile  
 
PostPosted: November 6th, 2013, 7:46 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Thanks 9yomo! :)

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: November 6th, 2013, 7:48 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: November 6th, 2013, 8:26 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: November 6th, 2013, 12:29 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: November 6th, 2013, 2:12 pm 
Offline
User avatar

Joined: July 9th, 2012, 1:14 pm
Posts: 112
It is just "sleep () //ms", for example:

function button1OnClick(Sender)
{
image1.visible = true;
sleep (2000); //ms
image1.visible = false;
}
sleep_example.rar [5.5 KiB]
Downloaded 220 times


Top
 Profile  
 
PostPosted: November 6th, 2013, 4:32 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: November 7th, 2013, 4:03 am 
Offline
User avatar

Joined: July 9th, 2012, 1:14 pm
Posts: 112
It is exactly the way 9yomo wrote already.

"you can also write this between every animate starts:
sleep(100);
It means that the next line of code will start in 100 millisecond after the previous line of code."
in your case e.g.:

Counter = Counter +1;
sleep(100)
rotator1.rotateAngle = -15 + (Math.cos((Counter%40)/40*2*Math.PI)/rockRange+0.25)/Math.PI*180 ;

Well, you asked for "sleep" but I don't think that this will meet your request. Most likely it would work with a timercore, "timeout" and "set interval". Maybe someone knows the exact code (unfortunately I don't know).
I would use a gif or animated png image to get this effect. It is easy to make and doesn't need much CPU power ("sleep" needs a lot).
sphere.gif
sphere.gif [ 13.27 KiB | Viewed 6460 times ]


Last edited by Dagedee on November 7th, 2013, 7:03 am, edited 2 times in total.

Top
 Profile  
 
PostPosted: November 7th, 2013, 4:47 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: November 7th, 2013, 7:01 am 
Offline
User avatar

Joined: July 9th, 2012, 1:14 pm
Posts: 112
Well, I know already that you are not very enthusiastic about gifs and animated png images. :D
But I made only positive experiences so far. Animated png and gif images need very little CPU power.
(You might check the attached widget) Okay, it takes some time to create them, but it saves a lot of CPU power on the other hand.
It took me not more than 10 min to create the gifs I used for the attached widget. I'm using Photoshop to create gifs but it is also possible to use Gimp or (the easiest way) to use Photoscape http://url9.de/OEo.


Last edited by Dagedee on November 11th, 2013, 5:15 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: November 7th, 2013, 7:48 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Good job Dagedee! 8-)
I only use GIMP for my widgets and yes I'm not so fun of the gifs and animated png. :lol:
But don't forget these:
1) More big and complicate image/widget = more resources
I'm almost sure that if you try to reproduce the balls movement from my widget you will see the real cpu consumption..
2) Needs a lot of images/frames so the movement will be fluid and more realistic possible.
Just compare the movement of the gif and the test widget... ;)

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: November 8th, 2013, 4:42 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Any help guys with the script..? :(

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: November 11th, 2013, 5:23 am 
Offline
User avatar

Joined: July 9th, 2012, 1:14 pm
Posts: 112
I've created some more widgets (gif & animated png) with smoother animation now, CPU is always at zero. (Used frames are 73, but I only had to create 36 the others are just copies.) If you will use very large images than the CPU consumption will increase, that's for sure. :)
spheres.gif
spheres.gif [ 118.05 KiB | Viewed 6404 times ]

spheres_examples.rar [188.89 KiB]
Downloaded 246 times


Top
 Profile  
 
PostPosted: November 11th, 2013, 5:37 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: November 11th, 2013, 6:28 am 
Offline
User avatar

Joined: July 9th, 2012, 1:14 pm
Posts: 112
You can determine the interval of every frame of a gif. :)
... I know you prefer a solution via script, hence I will not bug you any longer with gifs and animated pngs. :D
gif_setting.png
gif_setting.png [ 16.42 KiB | Viewed 6399 times ]


Last edited by Dagedee on November 11th, 2013, 10:10 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: November 11th, 2013, 8:44 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
No Dagedee of course you're not bother me! I appreciate your interest.. :)
Let's hope that someone will give me a hand with the script...

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: November 11th, 2013, 10:08 am 
Offline
User avatar

Joined: July 9th, 2012, 1:14 pm
Posts: 112
All right! :D


Top
 Profile  
 
PostPosted: November 15th, 2013, 10:39 pm 
Offline
User avatar

Joined: March 8th, 2013, 10:27 pm
Posts: 353
What's the thing with classic newtonian physics :lol: ?? :lol: :lol:
SHM was always difficult for me.... :mrgreen:

I'll see what I can do.

_________________
Life is a myriad game... Just play it!


Top
 Profile  
 
PostPosted: November 15th, 2013, 11:13 pm 
Offline
User avatar

Joined: March 8th, 2013, 10:27 pm
Posts: 353

_________________
Life is a myriad game... Just play it!


Top
 Profile  
 
PostPosted: November 16th, 2013, 2:49 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Thanks man!!! And yes I tested and the CPU is not good.. I will try to modify the delay times a bit so the movement will be more realistic as possible. There is too much delay between the balls at the end of their movement. About the delay function I will ask Tony if can provide me a patch with the delay enable. But I think that the other users must have the patch too so the widget will work fine on their pc right..? :(

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: November 19th, 2013, 6:47 pm 
Offline
User avatar

Joined: March 8th, 2013, 10:27 pm
Posts: 353
Yeah

_________________
Life is a myriad game... Just play it!


Top
 Profile  
 
PostPosted: November 19th, 2013, 6:53 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: December 3rd, 2013, 3:22 pm 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
i never had this kind of clock, so i don't know how exactly these clocks work,
but i guessed it should be this way:
so here's my solution:

Pendulum_Sphere_Clock.XWidgetPkg [254.49 KiB]
Downloaded 239 times


and just to note:
left ball doesn't have shadow on the ground


Top
 Profile  
 
PostPosted: December 3rd, 2013, 3:54 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: December 14th, 2013, 9:11 am 
Offline
User avatar

Joined: March 8th, 2013, 10:27 pm
Posts: 353
viewtopic.php?f=10&t=3667
Some interesting things were found here... it solves the cpu usage problem nicely, the rotateto() function specifically

_________________
Life is a myriad game... Just play it!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 28 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 68 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Powered by phpBB® Forum Software © phpBB Group