Commit abf65db8 authored by Tt's avatar Tt

更换图片 动态适配

parent a193b254
This diff is collapsed.
......@@ -47,6 +47,16 @@ export default class SceneComponent extends MyCocosSceneComponent {
question.id = id;
return question;
});
// 处理两侧的信息
let isWidth = cc.winSize.width / cc.winSize.height - 1920 / 1080;
if (isWidth > 0) {
this.layout_battery_left.getComponent(cc.Widget).left = 65;
this.layout_battery_right.getComponent(cc.Widget).right = 65;
} else {
this.layout_battery_left.getComponent(cc.Widget).left = 0;
this.layout_battery_right.getComponent(cc.Widget).right = 0;
}
console.log(isWidth);
}
// 当前数据
get currentQuestion() { return this.questions[this.current] }
......@@ -171,7 +181,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 右侧
let sid = (i + 1 - lineNum) % 2 + 5
pg.view.visible(pg.view.find(item, 'bg/img_battery' + sid), true)
item_text.x = 20
item_text.x = 10
item.x = 400;
if (this.current == 0) {
cc.tween(item).delay(delayTime).to(0.5, { x: 0 }).start();
......
......@@ -7,8 +7,8 @@
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 286,
"height": 232,
"width": 232,
"height": 189,
"platformSettings": {},
"subMetas": {
"img_battery001_dg18_tianci": {
......@@ -22,10 +22,10 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 286,
"height": 232,
"rawWidth": 286,
"rawHeight": 232,
"width": 232,
"height": 189,
"rawWidth": 232,
"rawHeight": 189,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
......@@ -7,8 +7,8 @@
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 281,
"height": 140,
"width": 249,
"height": 114,
"platformSettings": {},
"subMetas": {
"img_battery1_dg18_tianci": {
......@@ -22,10 +22,10 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 281,
"height": 140,
"rawWidth": 281,
"rawHeight": 140,
"width": 249,
"height": 114,
"rawWidth": 249,
"rawHeight": 114,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
......@@ -7,8 +7,8 @@
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 281,
"height": 140,
"width": 249,
"height": 113,
"platformSettings": {},
"subMetas": {
"img_battery2_dg18_tianci": {
......@@ -22,10 +22,10 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 281,
"height": 140,
"rawWidth": 281,
"rawHeight": 140,
"width": 249,
"height": 113,
"rawWidth": 249,
"rawHeight": 113,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
......@@ -7,8 +7,8 @@
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 281,
"height": 140,
"width": 249,
"height": 113,
"platformSettings": {},
"subMetas": {
"img_battery3_dg18_tianci": {
......@@ -22,10 +22,10 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 281,
"height": 140,
"rawWidth": 281,
"rawHeight": 140,
"width": 249,
"height": 113,
"rawWidth": 249,
"rawHeight": 113,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
......@@ -7,8 +7,8 @@
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 281,
"height": 140,
"width": 249,
"height": 113,
"platformSettings": {},
"subMetas": {
"img_battery4_dg18_tianci": {
......@@ -22,10 +22,10 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 281,
"height": 140,
"rawWidth": 281,
"rawHeight": 140,
"width": 249,
"height": 113,
"rawWidth": 249,
"rawHeight": 113,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
......@@ -7,8 +7,8 @@
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 281,
"height": 140,
"width": 249,
"height": 113,
"platformSettings": {},
"subMetas": {
"img_battery5_dg18_tianci": {
......@@ -22,10 +22,10 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 281,
"height": 140,
"rawWidth": 281,
"rawHeight": 140,
"width": 249,
"height": 113,
"rawWidth": 249,
"rawHeight": 113,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
......@@ -7,8 +7,8 @@
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 281,
"height": 140,
"width": 249,
"height": 113,
"platformSettings": {},
"subMetas": {
"img_battery6_dg18_tianci": {
......@@ -22,10 +22,10 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 281,
"height": 140,
"rawWidth": 281,
"rawHeight": 140,
"width": 249,
"height": 113,
"rawWidth": 249,
"rawHeight": 113,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
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