feat(assets): new assets loading system (currently only for images)
This commit is contained in:
@@ -1,18 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import BACKGROUND_IMAGE from "/assets/images/home/bottom-screen/background.webp";
|
||||
import TOP_BAR_IMAGE from "/assets/images/settings/bottom-screen/top-bar.webp";
|
||||
import BOTTOM_BAR_IMAGE from "/assets/images/settings/bottom-screen/bottom-bar.webp";
|
||||
|
||||
const [backgroundImage, topBarImage, bottomBarImage] = useImages(
|
||||
BACKGROUND_IMAGE,
|
||||
TOP_BAR_IMAGE,
|
||||
BOTTOM_BAR_IMAGE,
|
||||
);
|
||||
const { assets } = useAssets();
|
||||
|
||||
useRender((ctx) => {
|
||||
ctx.drawImage(backgroundImage!, 0, 0);
|
||||
ctx.drawImage(topBarImage!, 0, 0);
|
||||
ctx.drawImage(bottomBarImage!, 0, 168);
|
||||
ctx.drawImage(assets.home.bottomScreen.background, 0, 0);
|
||||
ctx.drawImage(assets.settings.bottomScreen.topBar, 0, 0);
|
||||
ctx.drawImage(assets.settings.bottomScreen.bottomBar, 0, 168);
|
||||
});
|
||||
|
||||
defineOptions({
|
||||
|
||||
Reference in New Issue
Block a user