Create Graphics with ETX CG Editor

66.4.16 Item Movement

You can make your items move vertically and horizontally. To do it, you should specify the item movement property.

Movement is specified in <movement> node of item XML description:

XML
<cg-item id='text-000'>
<text>Sample Text</text>
<cg-props scale='text-scale' align='top-left' edges-smooth='3' pos-x='970' pos-y='58' show='yes' move-type='accel-both' alpha='255' bg-color='Black(0)' pixel-ar='0.' play-mode='loop' interlace='auto' width='127' height='27' 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>
<movement speed-x='1.' speed-y='0.'/>
</cg-item>

The movement node contains two attributes: horizontal speed, specified by the speed-x attribute and vertical speed, defined by the speedy attribute. Values for these attributes are several pixels for shifting (horizontal or vertical) per frame. 

You can set item movement with the SetItemMovement method. This method contains the following parameters:

  • _bsItemID - item identifier
  • _pItemMove - movement parameters that are specified with CG_ITEM_MOVEMENT structure