fix deprecation warning

This commit is contained in:
saiminh 2026-01-23 12:14:59 +13:00
parent e277b33bd8
commit 176c6dc32a
2 changed files with 15 additions and 12 deletions

View file

@ -23,16 +23,19 @@ export default function createCanvasText(
elem.textContent = elem.textContent?.toUpperCase() as string; elem.textContent = elem.textContent?.toUpperCase() as string;
} }
// Use provided text object or create a new one // Use new PixiJS v8 syntax
const canvasText = textObject || new Text(elem.textContent as string, { const canvasText = textObject || new Text({
fontFamily: elemFontFamily, text: elem.textContent as string,
fontSize: parseInt(elemFontSize), style: {
fontWeight: elemFontWeight as PIXI.TextStyleFontWeight, fontFamily: elemFontFamily,
fontStyle: elemFontStyle as PIXI.TextStyleFontStyle, fontSize: parseInt(elemFontSize),
letterSpacing: elemLetterSpacing, fontWeight: elemFontWeight as PIXI.TextStyleFontWeight,
fill: elemColor, fontStyle: elemFontStyle as PIXI.TextStyleFontStyle,
align: elemAlignment as PIXI.TextStyleAlign, letterSpacing: elemLetterSpacing,
padding: 20, fill: elemColor,
align: elemAlignment as PIXI.TextStyleAlign,
padding: 20,
}
}); });
// Update existing text object properties // Update existing text object properties

View file

@ -13,9 +13,9 @@
} }
onMount(() => { onMount(() => {
console.log('layout mounted'); // console.log('layout mounted');
// Set initial random background color on first load // Set initial random background color on first load
// setRandomBgColor(); setRandomBgColor();
}); });
let { children }: { children: Snippet } = $props(); let { children }: { children: Snippet } = $props();