feat: centralize all screen related callbacks in useScreen
This commit is contained in:
@@ -6,7 +6,9 @@ const props = defineProps<{
|
||||
image: HTMLImageElement;
|
||||
}>();
|
||||
|
||||
useRender((ctx) => {
|
||||
const { onRender } = useScreen();
|
||||
|
||||
onRender((ctx) => {
|
||||
ctx.globalAlpha = props.opacity;
|
||||
ctx.drawImage(props.image, props.x, props.y);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user