feat: centralize all screen related callbacks in useScreen
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import gsap from "gsap";
|
||||
|
||||
const { onRender, onClick } = useScreen();
|
||||
|
||||
const { assets } = useAssets();
|
||||
const store = useProjectsStore();
|
||||
|
||||
@@ -77,7 +79,7 @@ useKeyUp((key) => {
|
||||
}
|
||||
});
|
||||
|
||||
useScreenClick((x, y) => {
|
||||
onClick((x, y) => {
|
||||
if (
|
||||
!store.showConfirmationPopup ||
|
||||
textProgress.value < 1 ||
|
||||
@@ -113,7 +115,7 @@ const drawTextWithShadow = (
|
||||
ctx.fillText(text, x, y);
|
||||
};
|
||||
|
||||
useRender((ctx) => {
|
||||
onRender((ctx) => {
|
||||
if (!store.showConfirmationPopup) return;
|
||||
|
||||
// frame
|
||||
|
||||
Reference in New Issue
Block a user