let c = this.node.getComponent(cc.Canvas);c.fitHeight = true;c.fitWidth = false; let h = 960 * cc.winSize.height / cc.winSize.width; c.designResolution = new cc.Size(960, h);this.node.setContentSize(960, h); // 适配解决方案 let _canvas = cc.Canvas.instance
Html: <input type="file" id="MapUploadTd" onchange="getMapPictureSize(this.files[0])"/> Js: var mapPictureSize = []; function getMapPictureSize(file) { var reader = new FileReader; reader.onload = function (evt) { var i