Transitions are used to gradually apply transforms over distance.
The VectorTransition class is used to gradually transform vector shapes over the length of a path. This feature is not SVG compliant, though it can be utilised from SVG files via the 'parasol:' name space.
The transition is defined as a series of stops and transform instructions, of which at least 2 are required in order to interpolate the transforms over distance. The transform strings are defined as per the SVG guidelines for the transform attribute.
The following example illustrates the use of a transition in SVG:
<defs> <parasol:transition id="hill"> <stop offset="0" transform="scale(0.3)"/> <stop offset="50%" transform="scale(1.5)"/> <stop offset="100%" transform="scale(0.3)"/> </parasol:transition> </defs> <rect fill="#ffffff" width="100%" height="100%"/> <text x="3" y="80" font-size="19.6" fill="navy" transition="url(#hill)">This text is morphed by a transition</text>
Transitions are most effective when used in conjunction with the morph feature in the Vector class.
The VectorTransition class consists of the following fields:
Access | Name | Type | Comment | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Stops | STRUCT [] | Defines the transforms that will be used at specific stop points. | ||||||||||
A valid transition object must consist of at least two stop points in order to transition from one transform to another. This is achieved by setting the Stops field with an array of Transition structures that define each stop point with a transform string. The Transition structure consists of the following fields:
| ||||||||||||
TotalStops | INT | Total number of stops defined in the Stops array. | ||||||||||
This read-only field indicates the total number of stops that have been defined in the Stops array. |
For VectorTransition definitions
Field | Type | Description |
---|---|---|
Offset | DOUBLE | An offset from 0.0 to 1.0 at which to apply the transform. |
Transform | CSTRING | A transform string, as per SVG guidelines. |
Class Info | |
---|---|
ID | ID_VECTORTRANSITION |
Category | Graphics |
Include | modules/vectortransition.h |
Version | 1 |