template/packages-user/client-modules/src/ui/background.tsx
unanmed b637d3b5f3 feat(09-01): dedup controller/background and fix load/title props base (D-10)
- Move render/ui/controller.tsx -> src/ui/controller.tsx keeping only mainUIController + createMainController; import MainBackgroundUI from ./background
- Move MainBackground/MainBackgroundUI/MainBackgroundProps ownership to src/ui/background.tsx; drop ../render import; add DefaultProps (render-vue) + IUIDefaultPropsBase (system)
- Fix load.tsx/title.tsx props base: IUIDefaultPropsBase -> IUIPropsBase (own ./types); drop unused system import in title.tsx
- Rewrite render capability imports from ../render barrel to ../render/use leaf (avoid render/index.tsx <-> ui cycle)
- Complete barrel: + ./controller ./background ./func (7 same-dir exports)
- Delete old render/ui/controller.tsx
2026-10-09 15:57:03 +08:00

25 lines
820 B
TypeScript

import { GameUI, SetupComponentOptions, IUIDefaultPropsBase } from '@motajs/system';
import { DefaultProps } from '@motajs/render-vue';
import { defineComponent } from 'vue';
import { MAIN_WIDTH, MAIN_HEIGHT } from '../shared';
export interface MainBackgroundProps
extends DefaultProps, IUIDefaultPropsBase {}
const mainBackgroundProps = {
props: ['controller', 'instance']
} satisfies SetupComponentOptions<MainBackgroundProps>;
export const MainBackground = defineComponent<MainBackgroundProps>(() => {
return () => (
<g-rect
loc={[0, 0, MAIN_WIDTH, MAIN_HEIGHT]}
fill
fillStyle="rgba(0, 0, 0, 0.8)"
/>
);
}, mainBackgroundProps);
/** 主 UI 控制器的背景 UI */
export const MainBackgroundUI = new GameUI('main-background', MainBackground);