[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/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 - HELP: How to make a second hand move more smoothly : CLOSED

XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently April 16th, 2024, 5:12 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: December 4th, 2015, 8:47 am 
Offline
User avatar

Joined: July 29th, 2013, 9:13 am
Posts: 609
I have a rotator for a second hand and have bound it to the datetimecore using the ${SecondPercent} tag to control clock hand movement. The hand moves one tick each second.

I would like to make the hand move more smoothly and to slide around the face moving in tenths of a second divisions. Is there a tag that does this automatically or do I have to do it in code?


Last edited by yereverluvinuncleber on December 16th, 2015, 8:38 am, edited 2 times in total.

Top
 Profile  
 
PostPosted: December 8th, 2015, 4:20 am 
Offline
User avatar

Joined: July 29th, 2013, 9:13 am
Posts: 609
BUMP: anyone out there with an idea as to how to do this with the IDE, timer cores and tags?

I can simply do it in code using javascript with the following function called by a timer with an interval of 0.1s

function updateTime() {
var theDate = new Date();

var theSeconds = theDate.getSeconds();
var theMilliseconds = theDate.getMilliseconds();
var useSeconds = Math.round(10 * (theSeconds + (theMilliseconds / 1000))) / 10;
secondHand.RotateAngle = (useSeconds * 6) % 360;
}

The above code is standard .js and might need fettling for Xwidget to extract the date/time information - Xwidget provides this sort of data.

Click on the second hand and unbind the datetimecore2 and remove the tag.
Clicking on datetimecore2 allows you to select the functions for it - you should add 'updateTime'.
This got the hands rotating at a 1 second interval.

Set the interval on datetime core to 100ms, smooth animation now achieved.

Do the same for any shadow image you have created and the shadow will rotate in synch. with the second hand.

Note: the hands only rotate when the widget is running and not in the IDE.


Last edited by yereverluvinuncleber on December 12th, 2015, 8:06 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: December 8th, 2015, 6:08 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
I don't understand very well your thought man, but check the "Animate" tab -> Switch Aanimation and test the various combinations/effects changing also the "Duration (Sec)". Keep in mind to control the cpu usage though...

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


Top
 Profile  
 
PostPosted: December 8th, 2015, 3:03 pm 
Offline
User avatar

Joined: July 29th, 2013, 9:13 am
Posts: 609
I'll have a look, thanks - but the usage of the switch animation is completely unclear to me and in the absence of any documentation I don't currently see how to use this part of the Xwidget IDE. If you have used it and have some examples then I'd appreciate the help.

Instead I have added that javascript function which is called by the datetime core on the onUpdate event. Instead of using the Xwidget functions it uses the rotateAngle property to rotate the second hand. It seems to work very well.

What I was looking for Jim is a way of using the ${SecondPercent} tag or similar to move the second hand smoothly rather than jerkily, the ${SecondPercent} tag rotates the hand only once per second.

That Konfabulator widget, the thread of which you deleted earlier, shows exactly how I want the hand to move.


Top
 Profile  
 
PostPosted: December 8th, 2015, 4: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 8th, 2015, 6:15 pm 
Offline
User avatar

Joined: July 29th, 2013, 9:13 am
Posts: 609
Thankyou Jim, I'll post the widget here shortly for you to have a look at. That widget you directed me to should be enough as it does some nifty stuff - I'll have a look and see how it does what it does, thanks!


Top
 Profile  
 
PostPosted: December 8th, 2015, 6:33 pm 
Offline
User avatar

Joined: July 29th, 2013, 9:13 am
Posts: 609
That is a very nifty effect and I do like it. I see what you are trying to recommend, to add a linear effect to the rotation of the hand, I can't get it to work but I like the idea.


Top
 Profile  
 
PostPosted: December 12th, 2015, 8:09 am 
Offline
User avatar

Joined: July 29th, 2013, 9:13 am
Posts: 609
See my second post on how I fixed it. Doing it in javascript code is much more simple than trying to figure out how to use an undocumented feature in Xwidgets.


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

All times are UTC - 8 hours


Who is online

Users browsing this forum: Bing [Bot] and 15 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