You can specify graphic effects for your items in Character Generator. Effects are nested in separated <effects> node in XML description of the item:
<cg-item id='text-000'> <text type='text' font='Arial' font-size='28' color='White' word-break='no'>Sample Text</text> <cg-props scale='text-scale' align='top-left' edges-smooth='0' pos-x='36' pos-y='24' show='yes' move-type='accel-both' alpha='255' bg-color='Black(0)' pixel-ar='0.' play-mode='loop' interlace='auto' width='251' height='46' pause='no'> <indent left='0' right='0' top='0' bottom='0' use-for-bg='no'/> <group-indent left='0' right='0' top='0' bottom='0'/> </cg-props> <effects> <shadow enabled='no' blur='6' alpha='200' color='Black' offset-x='3' offset-y='3'/> <blur enabled='no' size-x='7' size-y='7' align='center'/> <glow enabled='no' size-x='8' size-y='8' value='3.45' blend='0.80'/> <motion-blur enabled='yes' blend='0.65' auto-speed='2.0' speed-x='2.0' speed-y='2.0'/> </effects> </cg-item>
Here is a list of available effects and parameters. For greater clarity, here is a base item for which effects are implemented:
Effect | Description | Possible parameters | Example |
---|---|---|---|
shadow | adds shadow to the item | enabled - Indicates whether the effect is implemented to the item. Possible values: 'yes', 'no'. blur - a blur of the shadow in pixels. alpha - opacity of shadow. Possible values: from 0 (transparent) to 255 (solid). color - color of the shadow. offset-x - horizontal offset of the shadow from the item in pixels. offset-y - vertical offset of the shadow from the item in pixels |
<shadow enabled='yes' blur='6' alpha='200' color='Black' offset-x='3' offset-y='3'/>![]() |
blur | adds blur effect to the item | enabled - indicates whether effect is implemented to the item. Possible values: 'yes', 'no'. size-x - amount of horizontal blur in pixels size-y - amount of vertical blur in pixels align - alignment of blur center. Possible values: 'top-left', 'top', 'top-right', 'left', 'center', 'right', 'bottom-left', 'bottom', 'bottom-right' |
<blur enabled='yes' size-x='7' size-y='7' align='center'/>![]() |
glow | add glow effect to the item | enabled - indicates whether effect is implemented to the item. Possible values: 'yes', 'no'. size-x - amount of horizontal glow in pixels size-y - amount of vertical glow in pixels value - radius of glow effect blend - blend level for the effect |
<glow enabled='yes' size-x='8' size-y='8' value='3.45' blend='0.80'/>![]() |
motion-blur | adds additional blur effect for moving items | enabled - indicates whether effect is implemented to the item. Possible values: 'yes', 'no'. blend - blend level for the effect auto-speed - default value for motion-blurriness speed-x - horizontal speed for blurriness. If '0' - auto-speed value is used. speed-y - vertical speed for blurriness. If '0' - auto-speed value is used. |
<motion-blur enabled='yes' blend='0.65' auto-speed='2.0' speed-x='2.0' speed-y='2.0'/>![]() |
There is no specific method to add or remove the effects. So the only way to manage effects is to set the properties via code:
string myItemId = "text-000"; string propertyName = "effects::blur::enabled"; string propertyValue = "yes"; int timeForChange = 1000; string changeType = ""; myCharGen.SetItemProperties(myItemId, propertyName, propertyValue, changeType, timeForChange);