Loads of button generator additions

This commit is contained in:
Dan 2026-01-13 12:34:41 +00:00
parent 98b4edf47d
commit e7754141bf
12 changed files with 904 additions and 126 deletions

View file

@ -245,12 +245,17 @@ export class ExternalImageBackgroundEffect extends ButtonEffect {
apply(context, controlValues, animState, renderData) {
const file = controlValues['bg-image-file'];
const bgColor = controlValues['bg-color'] || '#FFFFFF';
const fitMode = controlValues['bg-image-fit'] || 'cover';
const opacity = controlValues['bg-image-opacity'] ?? 1;
const zoom = controlValues['bg-image-zoom'] ?? 100;
const offsetX = controlValues['bg-image-offset-x'] ?? 50;
const offsetY = controlValues['bg-image-offset-y'] ?? 50;
// Draw background color first (always, for all states)
context.fillStyle = bgColor;
context.fillRect(0, 0, renderData.width, renderData.height);
// If no file selected, fill with a placeholder color
if (!file || !file.blobUrl) {
context.fillStyle = '#cccccc';