diff --git a/index.html b/index.html index 5be5cff..e833ef9 100644 --- a/index.html +++ b/index.html @@ -20,14 +20,8 @@ -
-
- - - 此浏览器不支持HTML5 - - -
+
+
diff --git a/packages-user/client-modules/src/render/components/input.tsx b/packages-user/client-modules/src/render/components/input.tsx index 68e1eca..9f219b4 100644 --- a/packages-user/client-modules/src/render/components/input.tsx +++ b/packages-user/client-modules/src/render/components/input.tsx @@ -155,7 +155,7 @@ export const Input = defineComponent( now = now.parent; } - // 应用内边距偏移. + // 应用内边距偏移 const { clientLeft, clientTop } = canvas; const trans = new Transform(); trans.translate(clientLeft, clientTop); diff --git a/packages-user/client-modules/src/render/shared.ts b/packages-user/client-modules/src/render/shared.ts index 9a84166..add5d24 100644 --- a/packages-user/client-modules/src/render/shared.ts +++ b/packages-user/client-modules/src/render/shared.ts @@ -2,18 +2,20 @@ export const MAP_BLOCK_WIDTH = 15; export const MAP_BLOCK_HEIGHT = 15; -// 状态栏像素宽高 -export const STATUS_BAR_WIDTH = 180; -export const STATUS_BAR_HEIGHT = 32 * MAP_BLOCK_HEIGHT; - -// 是否启用右侧状态栏 -export const ENABLE_RIGHT_STATUS_BAR = true; -export const STATUS_BAR_COUNT = ENABLE_RIGHT_STATUS_BAR ? 2 : 1; - // 地图像素宽高 export const MAP_WIDTH = 32 * MAP_BLOCK_WIDTH; export const MAP_HEIGHT = 32 * MAP_BLOCK_HEIGHT; +// 状态栏像素宽高 +export const STATUS_BAR_WIDTH = 180; +export const STATUS_BAR_HEIGHT = 32 * MAP_BLOCK_HEIGHT; +// 右侧状态栏的横坐标 +export const RIGHT_STATUS_POS = STATUS_BAR_WIDTH + MAP_WIDTH; + +// 是否启用右侧状态栏 +export const ENABLE_RIGHT_STATUS_BAR = true; +export const STATUS_BAR_COUNT = ENABLE_RIGHT_STATUS_BAR ? 2 : 1; + // 游戏画面像素宽高,宽=地图宽度+状态栏宽度*状态栏数量 export const MAIN_WIDTH = MAP_WIDTH + STATUS_BAR_WIDTH * STATUS_BAR_COUNT; export const MAIN_HEIGHT = MAP_HEIGHT; diff --git a/packages-user/client-modules/src/render/ui/main.tsx b/packages-user/client-modules/src/render/ui/main.tsx index f146135..fae5423 100644 --- a/packages-user/client-modules/src/render/ui/main.tsx +++ b/packages-user/client-modules/src/render/ui/main.tsx @@ -19,8 +19,12 @@ import { import { Textbox, Tip } from '../components'; import { GameUI } from '@motajs/system-ui'; import { + ENABLE_RIGHT_STATUS_BAR, MAIN_HEIGHT, MAIN_WIDTH, + MAP_HEIGHT, + MAP_WIDTH, + RIGHT_STATUS_POS, STATUS_BAR_HEIGHT, STATUS_BAR_WIDTH } from '../shared'; @@ -71,7 +75,7 @@ const MainScene = defineComponent(() => { const mainTextboxProps: Props = { text: '', hidden: true, - loc: [0, 330, 480, 150], + loc: [0, MAP_HEIGHT - 150, MAIN_WIDTH, 150], zIndex: 30, fillStyle: '#fff', titleFill: 'gold', @@ -80,7 +84,7 @@ const MainScene = defineComponent(() => { winskin: 'winskin2.png', interval: 100, lineHeight: 4, - width: 480 + width: MAP_WIDTH }; const map = shallowRef(); @@ -267,10 +271,13 @@ const MainScene = defineComponent(() => { status={leftStatus} hidden={hideStatus.value} > - + { /> - + { noevent >