Canvacord

ImageGenerationTemplate

Creates a new ImageGenerationTemplate instance.

new ImageGenerationTemplate([width], [height])
ParameterTypeDescriptionOptional
width

The width of the template

height

The height of the template

Properties

gif

The gif options.

Type:EncoderOptions

readonly height

The height of the template

Type:number

steps

The steps to apply to the canvas.

readonly width

The width of the template

Type:number

Methods

addStep(step);

Adds a step to the template.

ParameterTypeDescriptionOptional
step

The step to add

addSteps(steps);

Adds steps to the template.

ParameterTypeDescriptionOptional
steps

The steps to add

clearSteps();

Clears the steps.

getHeight();

Returns the height of the template.

getWidth();

Returns the width of the template.

isGif();

Returns whether the template is a gif.

Returns:boolean

isInferrable();

Returns whether the size is inferrable.

Returns:boolean

setGifOptions([options]);

Sets the gif options.

ParameterTypeDescriptionOptional
options
EncoderOptions

The gif options

setSteps(steps);

Sets the steps. This will overwrite any existing steps.

ParameterTypeDescriptionOptional
steps

The steps to set

toJSON();

Returns the JSON representation of the template.

static from(template);

Creates a new ImageGenerationTemplate instance from a template.

ParameterTypeDescriptionOptional
template

The template to use

The created template