Commit 7aa5f95f authored by limingzhe's avatar limingzhe

fix: 宽屏适配

parent 95376d65
...@@ -60,7 +60,9 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -60,7 +60,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
); );
const ground = cc.find('Canvas/bg_ground'); const ground = cc.find('Canvas/bg_ground');
ground.scale = canvas.width / ground.width; const gsx = canvas.width / ground.width;
const gsy = canvas.height / ground.height;
ground.scale = Math.min(gsx, gsy);
const grass = cc.find('Canvas/bg_ground/bg_grass'); const grass = cc.find('Canvas/bg_ground/bg_grass');
const box = grass.getBoundingBox(); const box = grass.getBoundingBox();
......
{
"ver": "2.3.5",
"uuid": "379cb164-2bd3-47a5-b08e-7b9c2424d079",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1280,
"height": 600,
"platformSettings": {},
"subMetas": {
"bg_bg_new": {
"ver": "1.0.4",
"uuid": "23da7e17-e46e-46c0-a4b4-f47c7a23a98c",
"rawTextureUuid": "379cb164-2bd3-47a5-b08e-7b9c2424d079",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -2.5,
"trimX": 0,
"trimY": 5,
"width": 1280,
"height": 595,
"rawWidth": 1280,
"rawHeight": 600,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "b7124037-7f4c-46bd-b4c7-0b4cbd4193b6", "uuid": "462e506b-9760-4df1-99fe-db2e18ae21f0",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 971, "width": 634,
"height": 721, "height": 360,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg_bottom": { "bg_bottom": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "715cf873-7964-4e30-a4ce-be8ccf0db483", "uuid": "d7895aa2-3fa0-43a6-900f-f640061ee72c",
"rawTextureUuid": "b7124037-7f4c-46bd-b4c7-0b4cbd4193b6", "rawTextureUuid": "462e506b-9760-4df1-99fe-db2e18ae21f0",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": 0, "offsetX": 0,
"offsetY": 0, "offsetY": -0.5,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 1,
"width": 971, "width": 1268,
"height": 721, "height": 719,
"rawWidth": 971, "rawWidth": 1268,
"rawHeight": 721, "rawHeight": 720,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{
"ver": "2.3.5",
"uuid": "b7124037-7f4c-46bd-b4c7-0b4cbd4193b6",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 971,
"height": 721,
"platformSettings": {},
"subMetas": {
"bg_bottom_old": {
"ver": "1.0.4",
"uuid": "715cf873-7964-4e30-a4ce-be8ccf0db483",
"rawTextureUuid": "b7124037-7f4c-46bd-b4c7-0b4cbd4193b6",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 971,
"height": 721,
"rawWidth": 971,
"rawHeight": 721,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "f4523bc5-8c79-4fc6-ad1f-c36ac48dbf7f",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 2560,
"height": 1200,
"platformSettings": {},
"subMetas": {
"bg_sky_new": {
"ver": "1.0.4",
"uuid": "26cfcd53-ee9b-4c45-ab2a-ab13afdb9240",
"rawTextureUuid": "f4523bc5-8c79-4fc6-ad1f-c36ac48dbf7f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1280,
"height": 600,
"rawWidth": 1280,
"rawHeight": 600,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment