TGML Code Snippets

A snippet is a stored piece of TGML code. It can be used for reusing constructs such as preconfigured animations and gradients.

A snippet file contains only one TGML snippet. The root element includes at least two Metadata elements describing the snippet; one for Name and one for Description. It is recommended that the file name matches the Name metadata.

Copy
<Metadata Name="Name" Value="Blink"/>
<Metadata Name="Description" Value="Blink twice per second"/>

The example below is an animation snippet that can be inserted as a child to any graphical (renderable) TGML element:

Copy
<Animate Attribute="Visibility" Duration="1.0" From="Visible" To="Hidden">
    <Metadata Name="Name" Value="Blink"/>
    <Metadata Name="Description" Value="Blink twice per second"/>
</Animate>