20 lines
327 B
Vue
20 lines
327 B
Vue
<script setup lang="ts">
|
|
const props = defineProps<{
|
|
x: number;
|
|
y: number;
|
|
opacity: number;
|
|
image: HTMLImageElement;
|
|
}>();
|
|
|
|
const { onRender } = useScreen();
|
|
|
|
onRender((ctx) => {
|
|
ctx.globalAlpha = props.opacity;
|
|
ctx.drawImage(props.image, props.x, props.y);
|
|
});
|
|
|
|
defineOptions({
|
|
render: () => null,
|
|
});
|
|
</script>
|