sequence_keyframedata_new

With this function you can create a new keyframe data struct, supplying the type of track that the keyframe data will be applied to. The type argument can be any one of the Sequence Track Type Constants listed on this page.

The function will return a track keyframe data struct which can then have values added to it before being assigned to a keyframe struct.

 

Syntax:

sequence_keyframedata_new(type);

ArgumentTypeDescription
typeSequence Track Type ConstantThe type of keyframe data to create.

 

Returns:

Sequence Keyframe Data Struct

 

Example:

myseq = sequence_create();
var mytracks = array_create(1);
mytracks[0] = sequence_track_new(seqtracktype_graphic);
var graphickeys = array_create(1);
graphickeys[0] = sequence_keyframe_new(seqtracktype_graphic);
graphickeys[0].frame = 0;
graphickeys[0].length = 1;
graphickeys[0].stretch = true;
graphickeys[0].disabled = false;
var graphickeydata = array_create(1);
graphickeydata[0] = sequence_keyframedata_new(seqtracktype_graphic);
graphickeydata[0].spriteIndex = spr_Platform;
graphickeydata[0].channel = 0;
graphickeys[0].channels = graphickeydata;
mytracks[0].name = "TestGraphicTrack";
mytracks[0].keyframes = graphickeys;
myseq.tracks = mytracks;

The above code creates a new sequence and then creates a graphic asset track and sets some keyframe data on the track. This track is then assigned to the instance.