StickerConfig interface
Configuration for defining a sticker object that can be passed into the recording layout
Signature:
export interface StickerConfig
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
allowDragging? | readonly | boolean | (Optional) Whether to allow the user to drag the sticker or not |
allowRotation? | readonly | boolean | (Optional) Whether to allow the user to manually rotate the sticker or not |
autoPlay? | readonly | boolean | (Optional) Whether an animated sticker (gif or webp) should start playing automatically after loading or being reset. |
displayAsset | readonly | ImageAsset | Image asset that will be used as the display for the sticker |
loop? | readonly | boolean | (Optional) Whether the sticker should loop playback or not, if it's a gif or webp |
maxScale? | readonly | number | (Optional) Maximum scale the sticker can be scaled to. |
minScale? | readonly | number | (Optional) Minimum scale the sticker can be scaled to. Stickers always default to a scale of 1. |
position? | readonly | Vector2 | (Optional) Default position for the center of the sticker when initialized, normalized to the screen size with (0, 0) at the bottom left |
rotation? | readonly | number | (Optional) Initial rotation of the sticker, in degrees |
size? | readonly | Vector2 | (Optional) Default size for the sticker, normalized to the width of the screen. The sticker will fit inside this area while maintaining its original aspect ratio |
StickerConfig.allowDragging property
Whether to allow the user to drag the sticker or not
Signature:
readonly allowDragging?: boolean;
Remarks
Defaults to true if not set
StickerConfig.allowRotation property
Whether to allow the user to manually rotate the sticker or not
Signature:
readonly allowRotation?: boolean;
Remarks
Defaults to true if not set
StickerConfig.autoPlay property
Whether an animated sticker (gif or webp) should start playing automatically after loading or being reset.
Signature:
readonly autoPlay?: boolean;
Remarks
Defaults to true if not set. All stickers will play when recording starts regardless of this setting.
StickerConfig.displayAsset property
Image asset that will be used as the display for the sticker
Signature:
readonly displayAsset: ImageAsset;
StickerConfig.loop property
Whether the sticker should loop playback or not, if it's a gif or webp
Signature:
readonly loop?: boolean;
Remarks
Defaults to true if not set
StickerConfig.maxScale property
Maximum scale the sticker can be scaled to.
Signature:
readonly maxScale?: number;
Remarks
Defaults to 2.0 if not set
StickerConfig.minScale property
Minimum scale the sticker can be scaled to. Stickers always default to a scale of 1.
Signature:
readonly minScale?: number;
Remarks
To disable scaling entirely, you can set both the min and max scale to 1. Defaults to 0.5 if not set
StickerConfig.position property
Default position for the center of the sticker when initialized, normalized to the screen size with (0, 0) at the bottom left
Signature:
readonly position?: Vector2;
Remarks
Defaults to the center of the screen (0.5, 0.5) if not set
StickerConfig.rotation property
Initial rotation of the sticker, in degrees
Signature:
readonly rotation?: number;
Remarks
Defaults to 0 if not set
StickerConfig.size property
Default size for the sticker, normalized to the width of the screen. The sticker will fit inside this area while maintaining its original aspect ratio
Signature:
readonly size?: Vector2;
Remarks
Both width and height are normalized to the screen width, so if you set the same value for both it will result in a square area. Defaults to (0.4, 0.4) if not set
Updated 8 months ago