|
@@ -7,6 +7,7 @@
|
|
|
:style="{
|
|
:style="{
|
|
|
width: systemInfo.windowWidth + 'px',
|
|
width: systemInfo.windowWidth + 'px',
|
|
|
height: HEIGHT + 'px',
|
|
height: HEIGHT + 'px',
|
|
|
|
|
+ backgroundColor: backgroundColor,
|
|
|
}"
|
|
}"
|
|
|
@touchstart="render.events.handleTouchStart"
|
|
@touchstart="render.events.handleTouchStart"
|
|
|
@touchmove="render.events.handleTouchMove"
|
|
@touchmove="render.events.handleTouchMove"
|
|
@@ -19,8 +20,9 @@
|
|
|
import type { VillageTreeAnimProps } from '@/api/light/LightVillageApi';
|
|
import type { VillageTreeAnimProps } from '@/api/light/LightVillageApi';
|
|
|
import { MiniRender } from '@/components/canvas/MiniRender';
|
|
import { MiniRender } from '@/components/canvas/MiniRender';
|
|
|
import { UniWeappRender } from '@/components/canvas/UniWeappRender';
|
|
import { UniWeappRender } from '@/components/canvas/UniWeappRender';
|
|
|
|
|
+import { useTheme } from '@/components/theme/ThemeDefine';
|
|
|
import { RandomUtils } from '@imengyu/imengyu-utils';
|
|
import { RandomUtils } from '@imengyu/imengyu-utils';
|
|
|
-import { getCurrentInstance, onBeforeUnmount, onMounted, watch } from 'vue';
|
|
|
|
|
|
|
+import { computed, getCurrentInstance, onBeforeUnmount, onMounted, watch } from 'vue';
|
|
|
|
|
|
|
|
let treeMain : MiniRender.AnimateSprite | null = null;
|
|
let treeMain : MiniRender.AnimateSprite | null = null;
|
|
|
|
|
|
|
@@ -40,7 +42,8 @@ const emit = defineEmits<{
|
|
|
(e: 'fruitPick'): void;
|
|
(e: 'fruitPick'): void;
|
|
|
}>();
|
|
}>();
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+const theme = useTheme();
|
|
|
|
|
+const backgroundColor = computed(() => theme.resolveThemeColor('background.primary'));
|
|
|
|
|
|
|
|
const HEIGHT = 260;
|
|
const HEIGHT = 260;
|
|
|
const instance = getCurrentInstance();
|
|
const instance = getCurrentInstance();
|
|
@@ -50,7 +53,7 @@ const render = new MiniRender.Scene(
|
|
|
canvas: new UniWeappRender('villageTree', instance),
|
|
canvas: new UniWeappRender('villageTree', instance),
|
|
|
width: systemInfo.windowWidth,
|
|
width: systemInfo.windowWidth,
|
|
|
height: HEIGHT,
|
|
height: HEIGHT,
|
|
|
- backgroundColor: '#000',
|
|
|
|
|
|
|
+ backgroundColor: backgroundColor.value!,
|
|
|
},
|
|
},
|
|
|
async function() {
|
|
async function() {
|
|
|
const bg = new MiniRender.Sprite();
|
|
const bg = new MiniRender.Sprite();
|