feat(settings): menu animations
This commit is contained in:
@@ -1,15 +1,24 @@
|
||||
<script setup lang="ts">
|
||||
import MENU_IMAGE from "/assets/images/settings/top-screen/touch_screen/touch_screen.webp";
|
||||
import MENU_IMAGE from "/assets/images/settings/top-screen/touch_screen/touch-screen.webp";
|
||||
import MENU_DISABLED_IMAGE from "/assets/images/settings/top-screen/touch_screen/touch-screen-disabled.png";
|
||||
|
||||
const props = defineProps<{
|
||||
x: number;
|
||||
y: number;
|
||||
isAnyOtherMenuOpen: boolean;
|
||||
}>();
|
||||
|
||||
const [menuImage] = useImages(MENU_IMAGE);
|
||||
const [menuImage, menuDisabledImage] = useImages(
|
||||
MENU_IMAGE,
|
||||
MENU_DISABLED_IMAGE,
|
||||
);
|
||||
|
||||
useRender((ctx) => {
|
||||
ctx.drawImage(menuImage!, props.x, props.y);
|
||||
if (props.isAnyOtherMenuOpen) {
|
||||
ctx.drawImage(menuDisabledImage!, props.x, props.y);
|
||||
} else {
|
||||
ctx.drawImage(menuImage!, props.x, props.y);
|
||||
}
|
||||
});
|
||||
|
||||
defineOptions({
|
||||
|
||||
Reference in New Issue
Block a user