<script setup lang="ts">
const props = defineProps<{
  selected: boolean;
}>();

const buttonImage = useTemplateRef("buttonImage");
const selectorImage = useTemplateRef("selectorImage");

const x = 33;
const y = 25;

useRender((ctx) => {
  if (!buttonImage.value || !selectorImage.value) return;

  ctx.drawImage(buttonImage.value, x, y);

  if (props.selected) {
    ctx.drawImage(selectorImage.value, x - 2, y - 2);
  }
});
</script>

<template>
  <img
    ref="buttonImage"
    src="/assets/images/home/bottom-screen/buttons/game.png"
    hidden
  />
  <img
    ref="selectorImage"
    src="/assets/images/home/bottom-screen/buttons/largeSelector.png"
    hidden
  />
</template>
