» Documentation, How to create your own cFos(Speed) skin -page 6

The slider method

led_green.bmp What we are going to do now is add a little LED-like display emitting a brief flash when changing states. Let's just go with the led_green.bmp from the cFos "Modern" skin for this section.

        [disp7]
        value=latency
        method=slider
        rect=111,50,117,56
        bitmap=led_green.bmp
        scale=2
        stepsize=1
        frames=3
        min=0
        max=2
        updatetime=200
        transform1=170,0,0,205,255,255,224,0,0,225,255,150
        transform2=0,0,0,10,255,255,225,190,140,226,191,141
      
This section displays the value of the latency parameter (see our skin definition reference page ), which can either be 0 (low latency is off) or 1 (low latency is on). With scale set to 2, the original parameter is projected onto a range from 0 to 2. In combination with stepsize , frames , min and max , this will have the animation run through all of its three frames each time the original value changes from 0 to 1. Animation speed is controlled by the value entered for updatetime , which determines the time each frame is shown in milliseconds.

Color transformations are used here to correct some minor glitches in the original bitmap's shadow colors.

Next step: Switching sections by using the activearea method

Powered by cFos Personal Net Web Server
Practice random kindness and senseless acts of beauty