<script setup lang="ts">
const props = defineProps<{
  x: number;
  y: number;
  opacity: number;
  image: {
    draw: (ctx: CanvasRenderingContext2D, x: number, y: number) => void;
  };
}>();

const { onRender } = useScreen();

onRender((ctx) => {
  ctx.globalAlpha = props.opacity;
  props.image.draw(ctx, props.x, props.y);
});

defineOptions({
  render: () => null,
});
</script>
