The motion method
is an animation that is being played for as long as the assigned value stays within a certain range. Let's use tcp3.tga
from the cFosSpeed
"Liquid Crystal" skin for displaying active TCP connections.
What this does is use the tcp_cnt
parameter of cFosSpeed
, which tracks the number of current TCP connections, while setting the min
value to "1." In other words, it will become active whenever one or more TCP connections are open.
contains two frames. The first is completely transparent (i.e., filled with transparentcolor
). This frame serves as the idleframe
, meaning it will be displayed when the tcp_cnt
is "0" and thus falls outside the range between min
. Note that for what we're trying to accomplish in this step, we can skip defining max
altogether, because there is really no need to specify an upper limit here.
By contrast, the second frame is the image that will be shown if the tcp_cnt
is "1" or more.
To make sure the motion stands out nicely from the background, we use transform1
to change its color from blue to red. And for providing precise numeric information, we also add a small text
section displaying the number of active TCP connections.
Now, let's do something a little more ambitious by adding the following motion:
This one (connect.bmp
from the cFos "Modern" skin) contains seven rather than just two frames. Again, the first is a fully transparent idleframe
The other frames compose an animation that is being played continuously while ping_time
stays above zero. To control animation speed, updatetime
is set to 120 ms. What we've also done is add a pause
of 2,000 ms after each time the animation has run through (i.e., after its last frame finished playing).
Transformations are again used here to handle some problems with the original bitmap's shadow colors.
For conveying accurate numeric values, we'll again need a brief text
section like the one below:
Note that both text
sections contain a "b" flag. What this does is make those sections empty (and thus invisible) while their value is zero.
Next step: The final touch: The fader methodThe activearea method The fader method Index