Animated Field

To have an animated field act like a GIF (not Jiff), you can use the new AnimatedField widget. The parameters are driven by the theme.xml.

You will have an image with the frames in a row. Hopefully someone will have time to write it so you can have multiple rows (hint: use modulus to find the row number). Specific the frame dimensions and the delay. The delay is in milliseconds.

<class name="AnimatedField">
    <style>
        <attribute name="frame-width">80</attribute>
        <attribute name="frame-height">80</attribute>
        <attribute name="frame-delay">100</attribute>
    </style>
    <images>
        <image name="composite">progress-strip-14.png</image>
    </images>
</class>

It works by using graphics.drawBitmap() like normal, however you can also specify a top and left parameter, which are offsets within the image. So what we do is shift the offsets around, and draw using the dimensions from frame-width and frame-height.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

© 2011 Metova, Inc.