做毕业设计网站的步骤,网站建设需求分析运行环境处理器型号及内存容量,十大免费行情软件下载网站,ftp网站上传 方法一、目前 cocos creater 不支持直接构建QQ小游戏#xff0c;需要构建成微信小游戏#xff0c;然后修改成QQ小游戏 二、构建QQ小游戏不能勾选 分离引擎 的选项#xff0c;勾选分离引擎的选项#xff0c;需要安装cocos微信小游戏引擎插件#xff0c;这个插件似乎目前只支持微…一、目前 cocos creater 不支持直接构建QQ小游戏需要构建成微信小游戏然后修改成QQ小游戏 二、构建QQ小游戏不能勾选 分离引擎 的选项勾选分离引擎的选项需要安装cocos微信小游戏引擎插件这个插件似乎目前只支持微信小游戏平台。 三、在QQ小程序中全局 globalThis.System 变量并未定义到 game.js 文件里在引入 SystemJS 支持的下一行加入代码globalThis.System global.System赋值globalThis.System。
四、进入build/wechatgame,找到game.json文件, 如果是竖屏修改 “deviceOrientation”: “landscapeRight” 为 “deviceOrientation”: “landscape” 。 五、在QQ小程序开发者工具上面预览打包好的页面图片拉伸变形不用慌张可能是QQ小程序开发者工具的问题用手机预览看看。 1、横屏游戏适配屏幕高度竖屏游戏适配屏幕宽度 2、cocos creater 3.x 分辨率动态适配代码 import { _decorator, Component, view, ResolutionPolicy, CCBoolean } from cc;
const { ccclass, property } _decorator;ccclass(AutoResolutionRules)
export class AutoResolutionRules extends Component {property(CCBoolean)private isCanvas: boolean false;onLoad() {if (this.isCanvas) {this.initResolutionRules();}}// 屏幕适配规则initResolutionRules() {var _desWidth view._designResolutionSize.width;var _desHeight view._designResolutionSize.height;var _realWidth view.getVisibleSize().width;var _realHeight view.getVisibleSize().height;var _ratioDes _desWidth / _desHeight;var _ratioReal _realWidth / _realHeight;if (_ratioReal _ratioDes) {view.setResolutionPolicy(ResolutionPolicy.FIXED_HEIGHT);} else {view.setResolutionPolicy(ResolutionPolicy.FIXED_WIDTH);}}
}