Medialooks Knowledge Base Support Center

Contact Us


A layer is a subtype of group item that is made for compositions. By default XML description of layer item looks like:

<cg-item group-type='layer' id='layer-000'>
 <cg-props pos-x='0' pos-y='0' width='1920' height='1080' show='yes' move-type='accel-both' alpha='255' bg-color='Black(0)' pixel-ar='0.' play-mode='loop' interlace='auto' scale='fit-ar' align='top-left' pause='no' edges-smooth='0'>
  <indent left='0' right='0' top='0' bottom='0' use-for-bg='no'/>
  <group-indent left='0' right='0' top='0' bottom='0'/>

To add a new layer with a code you should call:

string myLayerID = "myLayer";
string layerXML = "<layer/>";
double relativeX = 0.05;
double relativeY = 0.05;
int isRelative = 1;
int isShow = 1; myCharGen.AddNewItem(layerXML, relativeX, relativeY, isRelative, isShow, ref myLayerID);

There are no specific parameters for layer except the base ones. So you can manipulate with layer size, position, movement etc. 

You can display your compositions in separate layers with the CompositionsDisplayInLayer method. This method contains the following parameters:

A simple example for CompositionsDisplayInLayer looks like:

string myCompositionID = "composition-000";
string myParameters = "";
string targetLayer = "layer-000";
double inTime = 0.5;
double showTime = 5.0;
double hideTime = 1.5; 
myCharGen.CompositionsDisplayInLayer(myCompositionID, myParameters, targetLayer, inTime, showTime, hideTime);

With layers, you can easily set Z-order for your compositions - just set the layer item Z-order with the ChangeItemZOrder method:

myCharGen.ChangeItemZOrder(myLayerID, 10);