# PQMvc_egret **Repository Path**: longsf/PQMvc_egret ## Basic Information - **Project Name**: PQMvc_egret - **Description**: 基于egretMVC开发框架,适用个人开发小游戏,多人模式待调整,从AS3转化过来的自定义的UI解析,根据JSON数据显示界面 - **Primary Language**: TypeScript - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2018-12-11 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # PQMvc_egret 基于egret的MVC开发框架,从AS3转化过来的 自定义的UI解析,根据JSON数据显示界面 DEMO的UI布局放在Main.ts中的Config.configList,这个可根据需要放到外部或服务端加载 UI布局为JSON格式,编辑这个UI布局会比较麻烦,最好是借助其它编辑器生成布局文件。 我是用自己写的一个简单的UI编译器通过可视化界面编辑并生成JSON文件所以会方便点 布局支持img,btn,res,panel,txt img为图片,不可点击,btn可点击,res为资源配置,不会显示到界面上,panel是容器,配置后会自动创建一个空sprite,txt为文本框 除了res其它的都会显示在界面上,且提供以下属性供配置 public id: string; public url: string; public name: string; public x: number; public y: number; public alpha: number=1; public type: string; public color: any; public category: string; public key: string; public size: number; public text: string; public mask: string; public value: string; public visible: string; public align: string; /**水平焦点 0-1**/ public focusX: number = 0; /**垂直焦点 0-1**/ public focusY: number=0; public width: number; public height: number; /**父容器**/ public targetPanel: string; public touchEnabled: boolean; 如果需要其它属性也可自行添加,添加后只需要在view中添加对应的设置即可。 #使用: 1、创建项目并把pqmvc目录复制到src下 2、创建main.ts,view.ts,game.ts分别继承PqMain.ts,PqView.ts,PqGame.ts 3、放置资源,并在main.ts中配置UI布局(可通过其它可视化编辑器生成) 4、在game.ts中编写游戏逻辑 5、发布