优化横屏适配
This commit is contained in:
@@ -34,8 +34,10 @@
|
||||
"width": 1920,
|
||||
"height": 1080,
|
||||
"_mouseState": 2,
|
||||
"centerX": 0,
|
||||
"centerY": 0
|
||||
"left": 0,
|
||||
"right": 0,
|
||||
"top": 0,
|
||||
"bottom": 0
|
||||
},
|
||||
{
|
||||
"_$id": "2668mvhf",
|
||||
|
||||
BIN
assets/atlas/comp/White_left.png
Normal file
BIN
assets/atlas/comp/White_left.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.8 KiB |
6
assets/atlas/comp/White_left.png.meta
Normal file
6
assets/atlas/comp/White_left.png.meta
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"uuid": "f4fc5788-06e1-422c-876d-36b204a1f067",
|
||||
"importer": {
|
||||
"textureType": 2
|
||||
}
|
||||
}
|
||||
BIN
assets/atlas/comp/White_right.png
Normal file
BIN
assets/atlas/comp/White_right.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.2 KiB |
6
assets/atlas/comp/White_right.png.meta
Normal file
6
assets/atlas/comp/White_right.png.meta
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"uuid": "dc59dea2-ef06-43dd-898f-01d253952f0c",
|
||||
"importer": {
|
||||
"textureType": 2
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,10 @@
|
||||
"height": 1080,
|
||||
"_mouseState": 2,
|
||||
"drawCallOptimize": true,
|
||||
"left": 0,
|
||||
"right": 0,
|
||||
"top": 0,
|
||||
"bottom": 0,
|
||||
"_$comp": [
|
||||
{
|
||||
"_$type": "13e020d1-5ab8-4082-80ca-c0d208342103",
|
||||
@@ -63,6 +67,15 @@
|
||||
"skin": "res://2b008659-862a-4155-b094-ee87ba692be1",
|
||||
"color": "#ffffff"
|
||||
},
|
||||
{
|
||||
"_$id": "ksvwr0iw",
|
||||
"_$type": "Box",
|
||||
"name": "center",
|
||||
"width": 1920,
|
||||
"height": 1080,
|
||||
"centerX": 0,
|
||||
"centerY": 0,
|
||||
"_$child": [
|
||||
{
|
||||
"_$id": "5u982vt1",
|
||||
"_$type": "Box",
|
||||
@@ -139,7 +152,7 @@
|
||||
"_$id": "mspovqw2",
|
||||
"_$type": "Sprite",
|
||||
"name": "Sprite(1)",
|
||||
"x": 44,
|
||||
"x": 36,
|
||||
"y": 298,
|
||||
"width": 876,
|
||||
"height": 280,
|
||||
@@ -568,3 +581,5 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -163,7 +163,7 @@
|
||||
"_$id": "c0d4puxi",
|
||||
"_$type": "Box",
|
||||
"name": "stars",
|
||||
"y": -168,
|
||||
"y": -142,
|
||||
"width": 984,
|
||||
"height": 300,
|
||||
"centerX": 0,
|
||||
|
||||
@@ -3,11 +3,14 @@
|
||||
"_$id": "mydj8ynl",
|
||||
"_$type": "Box",
|
||||
"name": "GameDone_Normal_H",
|
||||
"y": -784,
|
||||
"width": 1920,
|
||||
"height": 1080,
|
||||
"_mouseState": 2,
|
||||
"drawCallOptimize": true,
|
||||
"left": 0,
|
||||
"right": 0,
|
||||
"top": 0,
|
||||
"bottom": 0,
|
||||
"_$comp": [
|
||||
{
|
||||
"_$type": "13e020d1-5ab8-4082-80ca-c0d208342103",
|
||||
@@ -64,6 +67,15 @@
|
||||
"skin": "res://2b008659-862a-4155-b094-ee87ba692be1",
|
||||
"color": "#ffffff"
|
||||
},
|
||||
{
|
||||
"_$id": "bhko8e4w",
|
||||
"_$type": "Box",
|
||||
"name": "center",
|
||||
"width": 1920,
|
||||
"height": 1080,
|
||||
"centerX": 0,
|
||||
"centerY": 0,
|
||||
"_$child": [
|
||||
{
|
||||
"_$id": "80l6yqgl",
|
||||
"_$type": "Box",
|
||||
@@ -140,7 +152,7 @@
|
||||
"_$id": "nsr1mvtb",
|
||||
"_$type": "Sprite",
|
||||
"name": "Sprite(1)",
|
||||
"x": 44,
|
||||
"x": 36,
|
||||
"y": 298,
|
||||
"width": 876,
|
||||
"height": 280,
|
||||
@@ -167,7 +179,7 @@
|
||||
"_$id": "yt8pnsra",
|
||||
"_$type": "Box",
|
||||
"name": "stars",
|
||||
"y": 28,
|
||||
"y": 45,
|
||||
"width": 948,
|
||||
"height": 300,
|
||||
"centerX": 0,
|
||||
@@ -575,3 +587,5 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -7,9 +7,8 @@
|
||||
"width": 1920,
|
||||
"height": 960,
|
||||
"_mouseState": 2,
|
||||
"left": 0,
|
||||
"right": 0,
|
||||
"bottom": 0,
|
||||
"top": 120,
|
||||
"centerX": 0,
|
||||
"_$comp": [
|
||||
{
|
||||
"_$type": "692a672b-2457-456c-8093-321ea7a10e1b",
|
||||
@@ -44288,7 +44287,7 @@
|
||||
"_$id": "l9bah2a9",
|
||||
"_$type": "Sprite",
|
||||
"name": "normal",
|
||||
"x": 20,
|
||||
"x": 30,
|
||||
"y": -18,
|
||||
"width": 36,
|
||||
"height": 36,
|
||||
@@ -44328,7 +44327,7 @@
|
||||
"_$id": "bx8c1ghg",
|
||||
"_$type": "Sprite",
|
||||
"name": "ad",
|
||||
"x": 20,
|
||||
"x": 30,
|
||||
"y": -18,
|
||||
"width": 72,
|
||||
"height": 36,
|
||||
|
||||
@@ -309,6 +309,7 @@
|
||||
"_$type": "Label",
|
||||
"name": "label_star",
|
||||
"x": 80,
|
||||
"y": 4,
|
||||
"width": 111,
|
||||
"height": 72,
|
||||
"text": "31/31",
|
||||
|
||||
@@ -216,10 +216,10 @@
|
||||
"_$type": "Label",
|
||||
"name": "label_star",
|
||||
"x": 51,
|
||||
"y": 6,
|
||||
"y": 3,
|
||||
"width": 111,
|
||||
"height": 36,
|
||||
"centerY": 0,
|
||||
"height": 48,
|
||||
"centerY": 3,
|
||||
"text": "31/31",
|
||||
"font": "res://7322bbf9-175b-4a25-a0d7-72d369894de2",
|
||||
"fontSize": 30,
|
||||
@@ -7272,7 +7272,7 @@
|
||||
"y": 106,
|
||||
"width": 720,
|
||||
"height": 120,
|
||||
"top": 106,
|
||||
"bottom": 42,
|
||||
"centerX": 0,
|
||||
"_$comp": [
|
||||
{
|
||||
|
||||
@@ -278,12 +278,36 @@
|
||||
"_$id": "8354nuxx",
|
||||
"_$type": "Image",
|
||||
"name": "White",
|
||||
"x": 12,
|
||||
"x": 378,
|
||||
"y": 288,
|
||||
"width": 960,
|
||||
"width": 228,
|
||||
"height": 60,
|
||||
"centerX": 0,
|
||||
"skin": "res://5f574ee6-46ee-4c31-b0ec-95c5731e6102",
|
||||
"color": "#ffffff",
|
||||
"_$child": [
|
||||
{
|
||||
"_$id": "uoqz04df",
|
||||
"_$type": "Image",
|
||||
"name": "White_left",
|
||||
"x": -366,
|
||||
"width": 366,
|
||||
"height": 60,
|
||||
"skin": "res://f4fc5788-06e1-422c-876d-36b204a1f067",
|
||||
"color": "#ffffff"
|
||||
},
|
||||
{
|
||||
"_$id": "zsx33kbx",
|
||||
"_$type": "Image",
|
||||
"name": "White_right",
|
||||
"x": 228,
|
||||
"width": 366,
|
||||
"height": 60,
|
||||
"skin": "res://dc59dea2-ef06-43dd-898f-01d253952f0c",
|
||||
"useSourceSize": true,
|
||||
"color": "#ffffff"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -448,11 +448,34 @@
|
||||
"_$id": "d2khpcxf",
|
||||
"_$type": "Image",
|
||||
"name": "White",
|
||||
"x": 366,
|
||||
"y": 288,
|
||||
"width": 1830,
|
||||
"width": 1098,
|
||||
"height": 60,
|
||||
"skin": "res://5f574ee6-46ee-4c31-b0ec-95c5731e6102",
|
||||
"color": "#ffffff",
|
||||
"_$child": [
|
||||
{
|
||||
"_$id": "psz5ovz4",
|
||||
"_$type": "Image",
|
||||
"name": "White_left",
|
||||
"x": -366,
|
||||
"width": 366,
|
||||
"height": 60,
|
||||
"skin": "res://f4fc5788-06e1-422c-876d-36b204a1f067",
|
||||
"color": "#ffffff"
|
||||
},
|
||||
{
|
||||
"_$id": "p9bzjd1z",
|
||||
"_$type": "Image",
|
||||
"name": "White_right",
|
||||
"x": 1098,
|
||||
"width": 366,
|
||||
"height": 60,
|
||||
"skin": "res://dc59dea2-ef06-43dd-898f-01d253952f0c",
|
||||
"color": "#ffffff"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -51,16 +51,10 @@ export class UIManager extends Laya.Script {
|
||||
|
||||
private UIRoot: Laya.Panel
|
||||
public getUIRoot(): Laya.Node {
|
||||
if (config.H_SCREEN) {
|
||||
if (!this.UIRoot) {
|
||||
this.UIRoot = this.owner.getChildByName("UIRoot") as Laya.Panel
|
||||
this.UIRoot.width = config.DESIGN_HEIGHT
|
||||
this.UIRoot.height = config.DESIGN_WIDTH
|
||||
}
|
||||
return this.UIRoot
|
||||
} else {
|
||||
return this.owner
|
||||
}
|
||||
}
|
||||
|
||||
private topbar: TopBar
|
||||
|
||||
@@ -151,7 +151,7 @@ export class TopBar extends Laya.Script {
|
||||
})
|
||||
const sprite = this.item_sprites.get(difficulty)
|
||||
sprite.graphics.clear()
|
||||
sprite.graphics.drawRoundRect(0, 0, sprite.width, sprite.height, 12, 12, 12, 12, "#f5f7fb", "#1d5cdc", 5)
|
||||
sprite.graphics.drawRoundRect(0, 0, sprite.width, sprite.height, 12, 12, 12, 12, "#f5f7fb", "#1d5cdc", 3)
|
||||
|
||||
this.item_labels.forEach((label: Laya.Label) => {
|
||||
label.color = "#0e2a53"
|
||||
|
||||
Reference in New Issue
Block a user