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,8 +23,10 @@ export default function createCanvasText(
elem.textContent = elem.textContent?.toUpperCase() as string;
}
// Use provided text object or create a new one
const canvasText = textObject || new Text(elem.textContent as string, {
// Use new PixiJS v8 syntax
const canvasText = textObject || new Text({
text: elem.textContent as string,
style: {
fontFamily: elemFontFamily,
fontSize: parseInt(elemFontSize),
fontWeight: elemFontWeight as PIXI.TextStyleFontWeight,
@ -33,6 +35,7 @@ export default function createCanvasText(
fill: elemColor,
align: elemAlignment as PIXI.TextStyleAlign,
padding: 20,
}
});
// Update existing text object properties

View file

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