优化home加载

This commit is contained in:
2025-06-03 19:47:45 +08:00
parent ce90518d06
commit 483df4cf34
3 changed files with 18 additions and 12 deletions

View File

@@ -62,9 +62,9 @@
"_$id": "7270vjom", "_$id": "7270vjom",
"_$type": "Image", "_$type": "Image",
"name": "bg", "name": "bg",
"width": 936, "width": 16,
"height": 468, "height": 16,
"skin": "res://3dc757bc-61c3-480f-9ee1-1b1c57cf028b", "skin": "res://07b90718-84ee-4924-9098-8f0ee3663d92",
"useSourceSize": true, "useSourceSize": true,
"color": "#ffffff" "color": "#ffffff"
}, },
@@ -133,7 +133,8 @@
"_$comp": [ "_$comp": [
{ {
"_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17",
"scriptPath": "../src/views/common/CommonHover.ts" "scriptPath": "../src/views/common/CommonHover.ts",
"hoverAlpha": true
} }
], ],
"_$child": [ "_$child": [
@@ -184,7 +185,8 @@
"_$comp": [ "_$comp": [
{ {
"_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17",
"scriptPath": "../src/views/common/CommonHover.ts" "scriptPath": "../src/views/common/CommonHover.ts",
"hoverAlpha": true
} }
], ],
"_$child": [ "_$child": [
@@ -234,7 +236,8 @@
"_$comp": [ "_$comp": [
{ {
"_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17",
"scriptPath": "../src/views/common/CommonHover.ts" "scriptPath": "../src/views/common/CommonHover.ts",
"hoverAlpha": true
} }
], ],
"_$child": [ "_$child": [
@@ -265,7 +268,7 @@
"width": 468, "width": 468,
"height": 468, "height": 468,
"right": 0, "right": 0,
"skin": "res://7d235ac1-6755-4409-ab86-23aaf41e1537", "skin": "res://07b90718-84ee-4924-9098-8f0ee3663d92",
"color": "#ffffff" "color": "#ffffff"
} }
] ]
@@ -293,7 +296,8 @@
"_$comp": [ "_$comp": [
{ {
"_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17",
"scriptPath": "../src/views/common/CommonHover.ts" "scriptPath": "../src/views/common/CommonHover.ts",
"hoverAlpha": true
} }
], ],
"_$child": [ "_$child": [
@@ -351,7 +355,8 @@
"_$comp": [ "_$comp": [
{ {
"_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17",
"scriptPath": "../src/views/common/CommonHover.ts" "scriptPath": "../src/views/common/CommonHover.ts",
"hoverAlpha": true
} }
], ],
"_$child": [ "_$child": [
@@ -442,7 +447,8 @@
"_$comp": [ "_$comp": [
{ {
"_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17",
"scriptPath": "../src/views/common/CommonHover.ts" "scriptPath": "../src/views/common/CommonHover.ts",
"hoverAlpha": true
} }
], ],
"_$child": [ "_$child": [

View File

@@ -16,8 +16,6 @@ export class Main extends Laya.Script {
const resources: Array<{ url: string, type?: any, lazy?: boolean }> = [ const resources: Array<{ url: string, type?: any, lazy?: boolean }> = [
{ url: respath.score_add_ui_res()}, { url: respath.score_add_ui_res()},
{ url: respath.home_top_dc_bg_normal, type: Laya.Loader.IMAGE },
{ url: respath.home_top_dc_bg_finish, type: Laya.Loader.IMAGE },
{ url: respath.dc_top_bg_normal, type: Laya.Loader.IMAGE }, { url: respath.dc_top_bg_normal, type: Laya.Loader.IMAGE },
{ url: respath.dc_top_bg_month_finish, type: Laya.Loader.IMAGE }, { url: respath.dc_top_bg_month_finish, type: Laya.Loader.IMAGE },
{ url: respath.trophy_bg_light_gold, type: Laya.Loader.IMAGE }, { url: respath.trophy_bg_light_gold, type: Laya.Loader.IMAGE },

View File

@@ -150,6 +150,7 @@ export class TopBar extends Laya.Script {
} }
onOver(evt: Laya.Event): void { onOver(evt: Laya.Event): void {
Laya.Render.canvas.style.cursor = "pointer"
const Box = evt.target as Laya.Box const Box = evt.target as Laya.Box
const sprite = Box.getChildByName("Sprite") as Laya.Sprite const sprite = Box.getChildByName("Sprite") as Laya.Sprite
sprite.graphics.clear() sprite.graphics.clear()
@@ -157,6 +158,7 @@ export class TopBar extends Laya.Script {
} }
onOut(evt: Laya.Event): void { onOut(evt: Laya.Event): void {
Laya.Render.canvas.style.cursor = ""
const Box = evt.target as Laya.Box const Box = evt.target as Laya.Box
const sprite = Box.getChildByName("Sprite") as Laya.Sprite const sprite = Box.getChildByName("Sprite") as Laya.Sprite
sprite.graphics.clear() sprite.graphics.clear()