Hello,
Introduction:
Over the last few months I've quietly been familiarizing myself with DesktopX until I felt I'd reached a point where I at least had some decent understanding, Being an internet systems engineer and network engineer I tend to have a knack for reverse engineering things to gain understanding. Now I think I'm up to snuff enough to join you folks in your discussions and not frustrate you, or seem like an idiot.
I'd like to also say up front - many kudo's and thanks to RomanDA, sViz, & Martin for their wonderful tutorials, widgets, objects etc, (.dxpack's) that I dissected forwards and backwards, while scratching a trough into my hairline! (huh, what the heck, why would they put that there.....how does that work...????) Without your wonderful examples I would have been unable to accomplish the goals I have in mind, or to learn as much as I have already. Keep up the good work!
Now on to my question for sViz:
I pretty much cut my scripting teeth trying to understand your analog clock example. (and Martin's Calendar) Being completely unfamilar with VB, it took some "and what if I change this to this" with lots of DesktopX crashes (welcome to x64) to get a grasp on it. (I'm an engineer not a doctor! LOL - I don't design software, I design networks, so programming with VB is virgin territory for me.)
Anyway, in your script you have equations for the hour hand, minute hand and second hand, and I understand why, but here's my question:
the equation - h * 30 for the hour hand, always keeps the hour hand stuck on the current hour until the minute hand finally registers past it's 60th minute. (this makes the clock look like it's displaying 1:45 going on 2 PM, when it's really 2:45 going on 3 PM because the hour hand stays directly over the 2, and does not move half way in between the 2 and the 3 like a real analog clock. so up until 2:59, the hour hand stays directly above the 2, making it appear to be almost 2 oclock when it's really almost 3 oclock. (I hope I'm being clear enough on this)
(I've already tried changing 30 to higher numbers but that makes the hand always in between the hours on the face of the clock.)
My question is, how can this be corrected so the hour hand shows on top of the current hour, then as the hour progesses moves closer to the next hour like a real clock?
Thanks in advance!
Doc
Hello, Doc! First, major props for learning all this DX stuff, and congrats on your acheivements thus far!
Sounds pretty much like my learning experience. It can be maddening to get the hang of it. Welcome to the club.
As for the analog clock, I see what you're saying, and you're right. Naturally, the hour hand should progress over the hour.
Thanks to you, I went back and had a look at the script. I was surprised to find the solution was pretty simple!
Here's the revised script:
As you can see, the only thing that's changed is the hour rotation. We've moved it down because we need to get the minutes first. In addition to the original equation, we add another calculation which mulitplies the current minute by half.
There you go!
nice job
Right ON! You Rock! I'm going to try this right now and get back to you.
UPDATE: it appears to work perfectly! Nice fix and thanks! (now how long before vbscript codes and numbers float freely in my head so I can figure out this kind of stuff? LOL)
Now if I may add 1 more question:
It's been requested that I add a ticking sound to the clock. I've located a number of different great loopable samples, and applied each of them, however, as soon as another sound on the machine is activated, the ticking stops. (I assume because the focus was taken away by another sound) and the only way to get it back is to go into properties for the clock and click on ok or apply. any idea why it does this and how to get around it?
Thanks again by the way
P.S. More head scratches as to how my post on impulse disappeared from there and ended up here. Please ignore my "what the heck happened to my post!!!!????" post if it shows up LOL.
What sounds in particular? Windows sounds?
Make sure you set it to 'async sound loop' so it's continuous. I set up an object with a looped sound and none of my Windows sounds interfered, not even media player.
The only thing that stops a looped sound, for me, is another DX object that has sound; only one object in a theme/widget/gadget can play sound at a time.
In DXBuilder mode, any interaction with other objects (opening properties, applying settings, etc.) will stop the sound, but that shouldn't be a problem once you export your clock.
ahhh! Got it.
It wasn't windows sounds, but any dx object. I was unaware that in builder mode only 1 had the forefront at a time, thanks for the info, much appreciated!
-Doc
nice work sViz
All this was Greek to me, but I can tell you all the sVis is a scripting godess and a hell of a nice girl!
There are many great features available to you once you register, including:
Sign in or Create Account