From 84d1ac47980fcb22480c17657a4b2b89ea743a4a Mon Sep 17 00:00:00 2001 From: yangwen Date: Fri, 30 May 2025 16:43:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96hover=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/atlas/comp/btn_item.png | Bin 1901 -> 3702 bytes assets/atlas/comp/btn_item2.png | Bin 0 -> 3187 bytes assets/atlas/comp/btn_item2.png.meta | 6 +++ assets/resources/CommonTips.lh | 27 +++++++++--- assets/resources/Stage.lh | 49 +++++++++++++--------- assets/resources/Stage_H.lh | 60 ++++++++++++++++----------- assets/resources/TopBar.lh | 25 ++++++----- src/views/TopBar.ts | 19 +++++++-- src/views/common/CommonHover.ts | 11 ++++- 9 files changed, 132 insertions(+), 65 deletions(-) create mode 100644 assets/atlas/comp/btn_item2.png create mode 100644 assets/atlas/comp/btn_item2.png.meta diff --git a/assets/atlas/comp/btn_item.png b/assets/atlas/comp/btn_item.png index 589879631a12891274e80c977881be8745d68096..53219bb5b129dfa013ceafa06fad40a95b2abbef 100644 GIT binary patch literal 3702 zcmd5<2~<;O7LKBY;sTUdlr;@SqevE#s6~M~NAhLtM z(ItTE1v3f`djkQ&?BKr!62XlpDA zZ4KU57;6FsN3h1h-d=FfBcIMBco9i&{ee3>cnARS2q=_LC`1aeNG?AZg|V@*S%o>Np!VrEe4xK9$Y<)u@lL>Ad0YK%@7;Z#6I4FT+vFLQVON(SPIKU#8{u>v+EO((F*gViPk-=w0 zG3X>dmkoQ9Gl8{yEY{2Fz2(xEj|ICd7X=1`S~%I?o%Es!Y@dbYyWRyi@4BDC0b8CA z_I9}PL>L63{ltyvY^llYTNRG4$l%4-fa8d!aoRkIT{;`wBg(Q(`PXdqef}+7d%$Ep={_ zGL?#q7uz)dghTZaf}m@t$T%^)+2CfgdUp_MyuM0Tc>&#)(6j3W;)T|jk8CudvVR&o zIH#{nq{bLBX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`KlFExVth=&5GSX**i|y$ucC3@egdR6|gGcgHO-cQJs^=h#WZJKm zc}SY_q4+9#^l&zJYB1*2-8F>~mRS_;9@))b1Hwc7i`XrD7977iVEFo?#?!?P`0#Ez{ D{*|sa delta 1237 zcmew+^OjGsGr-TCmrII^fq{Y7)59eQNVhOBFfwqk0a-;t_wH^~)M8R_G;uO8cXqKb zHgPmJG;}ktG%|8?bTxBzc62gucC>VxoXsQyQ)G!#(Q+n(7^q2RxD+WV6qf|0rdg%r zCzs}?=9PH5*eX@z7U-p9rdUDsn&Z+t*_hd>UZCW68v_IL9Zwg>kcwMxZYBB!M@lq2 zd_U)Qrx{!OZl>KV5sZ(yQo;;&Fg@nFBKrb}OV|%^9g~d+zi^C4Q*!V3ifE0d2BGAh zZ+7S9Jv8d=?$tfNGbO}}GvcIMgMt7{lY;;UlcNF$OCtt{!BL?en>a!Tf`!8%9Ks08 z5G<^2sBZ!~f_OLByYG6*z5Mbf$*ULh&RzA>%+&U>epOd{nWNq`RZP=g>6WKobK&QO zmTO)=eA3QpIQN|UPOpBiE!9jvV())TjagI~n4cq4Q!a42cfxc3V6T3k`jXtf=I~tM z^ZT|LUMh`N4BdFY*4pUUR%6Yx$JdpM$?(hHqe|~-*$Lxja z*UvwD{8!)H)v7+-YsCilKGtKi#r|K;WFD>vS#7wXoXxY+8RDPPgoMYx7JU1cqSp>uO^3{U9JQpp6CTd9)aL*swXM< zv08>J2^@@K4NNMeFUo0K1W zCs^WswBqO1b(eKq>rz!}?evm1Z8Ws8seY3)`_rM2UwdR9z1(^HT*odszn~@0-7b5x zm%rzWkLP%l;(e!TTZHVh%j*{}GWq!7(6)%$%{#oOn7!*>#U4+l}2-?hCSV~yK2=AnNy;EW=G%V zil6bP0 Hl+XkKR5-s2 diff --git a/assets/atlas/comp/btn_item2.png b/assets/atlas/comp/btn_item2.png new file mode 100644 index 0000000000000000000000000000000000000000..07483028258174084f56f5775415692312858b99 GIT binary patch literal 3187 zcmcIn2~<;88V+EM#R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}^68A5k@^eT(OIaam$T#JE*@WxnX!M4=U5f4kC7 z=j}@mx;sGgr&{&)=}x-^R5j^W_FI_R^fD98`R5#z*Y8BlzxPWb!v%U^%_RpvsM9dhAiiV6SCC48C$`VMI2fr-}1OgJGgrP zA?$*{xOeX2{k;>Rzvljy&1-v_ai?U?w-rjqQs(0xZ2Xpv4N1q$+9HwZeLhPi=bwjCKMI|~*b4kWnUKVP)sgQzt!`9G-ke+ZztHGk#a{kzcBJ4iuz;?B)!yOEds z=zs@KGOz6hS$C)b=VlGHDm?<~eQ*Em*0FgeX2Um*MV({0i1Ri&^_tfvLtmK^_Z~1a z0>upkFx?(xLZcdYKdZ{hb|`6y*z?+SOf1hEoqD75z$$+v%u=+qN_0`~GE&xgL=?ls z=SU~I4~<>x50O@jva5G*)C;mGthUHf`c3E>!XCkDP%4DDC(Y7Pw&6@+^XS!cBObet zHbr>W@7v&by}4d!wrp0Pvy*JcL+ghXZCgok4m*@SQ%TLtYsNi^*&Ju+dI3kzFG_c zFbghaO zm9WPk{?g)P%JamIrrfTV+vW*61|&r%oOtBar7>;?`CL4dBms>;5^(l!z2vp=@aKN(duq@qDZJq?+kadHrz8~ zSFn))mO9pH8O)O_l5lTmw|?k z=3Sw=R(^YVG-GkTg?Xb@IxhySxL`eQ19f@DKz<3-hU!Zh!`jsegWLTTa7o0)G-$|3LEUW{p(XUOKa|wB zvL;ZbOLv_7rorOEzD(-}?W0pY`uei0c-G6to*$8yN@}WZszut{tLTwzK0J|BIzD$A z5xH~c?~10LQ^=>bf;6%)%@@5ST~GU5r2H*@XyL@@QRMTGl%@wMiilh7=l^k-O4q3^ zD3@pH))yv@_6;>hUUw}UB(+o>mli)cRX^&@&F%GGe-TQIZhg0Trxrx~J*Eib{mxhY O8Q{InA7AMallD)?81&%) literal 0 HcmV?d00001 diff --git a/assets/atlas/comp/btn_item2.png.meta b/assets/atlas/comp/btn_item2.png.meta new file mode 100644 index 0000000..2e6aa95 --- /dev/null +++ b/assets/atlas/comp/btn_item2.png.meta @@ -0,0 +1,6 @@ +{ + "uuid": "d8b02de6-eee7-47ea-b227-d6dbffdadae3", + "importer": { + "textureType": 2 + } +} \ No newline at end of file diff --git a/assets/resources/CommonTips.lh b/assets/resources/CommonTips.lh index b88da18..34f9306 100644 --- a/assets/resources/CommonTips.lh +++ b/assets/resources/CommonTips.lh @@ -104,6 +104,12 @@ "y": -12, "width": 412, "height": 120, + "_$comp": [ + { + "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", + "scriptPath": "../src/views/common/CommonHover.ts" + } + ], "_$child": [ { "_$id": "he6hpns9", @@ -159,6 +165,12 @@ "y": -12, "width": 412, "height": 120, + "_$comp": [ + { + "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", + "scriptPath": "../src/views/common/CommonHover.ts" + } + ], "_$child": [ { "_$id": "bqp1fe7k", @@ -213,9 +225,15 @@ "name": "toggle", "x": 320, "y": 424, - "width": 42, + "width": 330, "height": 42, "bottom": 54, + "_$comp": [ + { + "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", + "scriptPath": "../src/views/common/CommonHover.ts" + } + ], "_$child": [ { "_$id": "74puwx15", @@ -247,8 +265,7 @@ "name": "Image", "width": 43, "height": 42, - "centerX": 0, - "centerY": 0, + "mouseThrough": true, "skin": "res://6f23a1ca-70f5-467a-afc3-5b178a851423", "useSourceSize": true, "color": "#ffffff" @@ -261,9 +278,7 @@ "y": 2, "width": 400, "height": 42, - "left": 54, - "centerY": 2, - "text": "Don't ask me agin", + "text": "Don't ask me again", "font": "res://7322bbf9-175b-4a25-a0d7-72d369894de2", "fontSize": 30, "color": "rgba(84, 89, 98, 1)", diff --git a/assets/resources/Stage.lh b/assets/resources/Stage.lh index 2eb95b9..1743c70 100644 --- a/assets/resources/Stage.lh +++ b/assets/resources/Stage.lh @@ -76,7 +76,8 @@ "_$comp": [ { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true } ], "_$child": [ @@ -110,7 +111,8 @@ "_$comp": [ { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true } ] } @@ -44315,7 +44317,6 @@ "width": 196, "height": 192, "_mouseState": 2, - "stateNum": 2, "skin": "res://08a05164-eac8-4773-8e7d-749e477f1ee7", "label": "", "labelSize": 20, @@ -44324,7 +44325,8 @@ "_$comp": [ { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": false } ], "_$child": [ @@ -44369,7 +44371,6 @@ "width": 196, "height": 192, "_mouseState": 2, - "stateNum": 2, "skin": "res://08a05164-eac8-4773-8e7d-749e477f1ee7", "label": "", "labelSize": 20, @@ -44378,7 +44379,8 @@ "_$comp": [ { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": false } ], "_$child": [ @@ -44424,7 +44426,6 @@ "width": 196, "height": 192, "_mouseState": 2, - "stateNum": 2, "skin": "res://08a05164-eac8-4773-8e7d-749e477f1ee7", "label": "", "labelSize": 20, @@ -44433,7 +44434,8 @@ "_$comp": [ { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": false } ], "_$child": [ @@ -44535,7 +44537,6 @@ "width": 196, "height": 192, "_mouseState": 2, - "stateNum": 2, "skin": "res://08a05164-eac8-4773-8e7d-749e477f1ee7", "label": "", "labelSize": 20, @@ -44544,7 +44545,8 @@ "_$comp": [ { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": false } ], "_$child": [ @@ -44735,7 +44737,8 @@ }, { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true } ], "_$child": [ @@ -44833,7 +44836,8 @@ }, { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true } ], "_$child": [ @@ -44931,7 +44935,8 @@ }, { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true } ], "_$child": [ @@ -45040,7 +45045,8 @@ }, { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true } ], "_$child": [ @@ -45138,7 +45144,8 @@ }, { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true } ], "_$child": [ @@ -45236,7 +45243,8 @@ }, { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true } ], "_$child": [ @@ -45345,7 +45353,8 @@ }, { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true } ], "_$child": [ @@ -45443,7 +45452,8 @@ }, { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true } ], "_$child": [ @@ -45541,7 +45551,8 @@ }, { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true } ], "_$child": [ diff --git a/assets/resources/Stage_H.lh b/assets/resources/Stage_H.lh index d71fd0c..93c6717 100644 --- a/assets/resources/Stage_H.lh +++ b/assets/resources/Stage_H.lh @@ -44035,8 +44035,7 @@ "width": 220, "height": 150, "_mouseState": 2, - "stateNum": 2, - "skin": "res://08a05164-eac8-4773-8e7d-749e477f1ee7", + "skin": "res://d8b02de6-eee7-47ea-b227-d6dbffdadae3", "label": "", "labelSize": 20, "labelAlign": "center", @@ -44044,7 +44043,8 @@ "_$comp": [ { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": false } ], "_$child": [ @@ -44089,8 +44089,7 @@ "width": 220, "height": 150, "_mouseState": 2, - "stateNum": 2, - "skin": "res://08a05164-eac8-4773-8e7d-749e477f1ee7", + "skin": "res://d8b02de6-eee7-47ea-b227-d6dbffdadae3", "label": "", "labelSize": 20, "labelAlign": "center", @@ -44098,7 +44097,8 @@ "_$comp": [ { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": false } ], "_$child": [ @@ -44143,8 +44143,7 @@ "width": 220, "height": 150, "_mouseState": 2, - "stateNum": 2, - "skin": "res://08a05164-eac8-4773-8e7d-749e477f1ee7", + "skin": "res://d8b02de6-eee7-47ea-b227-d6dbffdadae3", "label": "", "labelSize": 20, "labelAlign": "center", @@ -44152,7 +44151,8 @@ "_$comp": [ { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": false } ], "_$child": [ @@ -44254,8 +44254,7 @@ "width": 220, "height": 150, "_mouseState": 2, - "stateNum": 2, - "skin": "res://08a05164-eac8-4773-8e7d-749e477f1ee7", + "skin": "res://d8b02de6-eee7-47ea-b227-d6dbffdadae3", "label": "", "labelSize": 20, "labelAlign": "center", @@ -44263,7 +44262,8 @@ "_$comp": [ { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": false } ], "_$child": [ @@ -44454,7 +44454,8 @@ }, { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true } ], "_$child": [ @@ -44545,7 +44546,8 @@ }, { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true } ], "_$child": [ @@ -44636,7 +44638,8 @@ }, { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true } ], "_$child": [ @@ -44739,7 +44742,8 @@ }, { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true } ], "_$child": [ @@ -44830,7 +44834,8 @@ }, { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true } ], "_$child": [ @@ -44921,7 +44926,8 @@ }, { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true } ], "_$child": [ @@ -45024,7 +45030,8 @@ }, { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true } ], "_$child": [ @@ -45115,7 +45122,8 @@ }, { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true } ], "_$child": [ @@ -45206,7 +45214,8 @@ }, { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true } ], "_$child": [ @@ -45299,7 +45308,8 @@ "_$comp": [ { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true } ], "_$child": [ @@ -45361,7 +45371,8 @@ "_$comp": [ { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true } ], "_$child": [ @@ -45500,7 +45511,8 @@ "_$comp": [ { "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", - "scriptPath": "../src/views/common/CommonHover.ts" + "scriptPath": "../src/views/common/CommonHover.ts", + "hoverAlpha": true } ] } diff --git a/assets/resources/TopBar.lh b/assets/resources/TopBar.lh index 0518310..b6d2c65 100644 --- a/assets/resources/TopBar.lh +++ b/assets/resources/TopBar.lh @@ -247,8 +247,9 @@ "lb": 12, "rb": 12, "percent": true, - "lineWidth": 1, - "fillColor": "rgba(14, 42, 83, 1)" + "lineWidth": 5, + "lineColor": "rgba(14, 42, 83, 1)", + "fillColor": "rgba(245, 247, 251, 1)" } ] }, @@ -310,8 +311,9 @@ "lb": 12, "rb": 12, "percent": true, - "lineWidth": 1, - "fillColor": "rgba(14, 42, 83, 1)" + "lineWidth": 5, + "lineColor": "rgba(14, 42, 83, 1)", + "fillColor": "rgba(245, 247, 251, 1)" } ] }, @@ -373,8 +375,9 @@ "lb": 12, "rb": 12, "percent": true, - "lineWidth": 1, - "fillColor": "rgba(14, 42, 83, 1)" + "lineWidth": 5, + "lineColor": "rgba(14, 42, 83, 1)", + "fillColor": "rgba(245, 247, 251, 1)" } ] }, @@ -436,8 +439,9 @@ "lb": 12, "rb": 12, "percent": true, - "lineWidth": 1, - "fillColor": "rgba(14, 42, 83, 1)" + "lineWidth": 5, + "lineColor": "rgba(14, 42, 83, 1)", + "fillColor": "rgba(245, 247, 251, 1)" } ] }, @@ -499,8 +503,9 @@ "lb": 12, "rb": 12, "percent": true, - "lineWidth": 1, - "fillColor": "rgba(14, 42, 83, 1)" + "lineWidth": 5, + "lineColor": "rgba(14, 42, 83, 1)", + "fillColor": "rgba(245, 247, 251, 1)" } ] }, diff --git a/src/views/TopBar.ts b/src/views/TopBar.ts index 439ffca..c9b9c85 100644 --- a/src/views/TopBar.ts +++ b/src/views/TopBar.ts @@ -36,7 +36,8 @@ export class TopBar extends Laya.Script { @property(Laya.Box) public obj_items: Laya.Box - private items: Map = new Map() + private item_sprites: Map = new Map() + private item_labels: Map = new Map() onStart(): void { // 如果是第一次以横屏启动游戏需要创建经典关卡 @@ -79,9 +80,11 @@ export class TopBar extends Laya.Script { for (let i = 0; i < this.obj_items.numChildren; i++) { const obj = this.obj_items.getChildAt(i) const value = config.DIFFICULTY_LIST[i] + const sprite = obj.getChildByName("Sprite") as Laya.Sprite + this.item_sprites.set(value, sprite) const label = obj.getChildByName("Label") as Laya.Label label.text = value - this.items.set(value, label) + this.item_labels.set(value, label) const common = obj.getComponent(CommonData) common.strValue = value obj.on(Laya.Event.CLICK, this, (evt: Laya.Event) => { @@ -140,10 +143,18 @@ export class TopBar extends Laya.Script { } updateDifficulty(difficulty: string): void { - this.items.forEach((label: Laya.Label) => { + this.item_sprites.forEach((sprite: Laya.Sprite) => { + sprite.graphics.clear() + sprite.graphics.drawRoundRect(0, 0, sprite.width, sprite.height, 12, 12, 12, 12, "#f5f7fb", "#0e2a53", 5) + }) + 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) + + this.item_labels.forEach((label: Laya.Label) => { label.color = "#0e2a53" }) - const label = this.items.get(difficulty) + const label = this.item_labels.get(difficulty) label.color = "#1d5cdc" } } diff --git a/src/views/common/CommonHover.ts b/src/views/common/CommonHover.ts index 00532d6..a225ef1 100644 --- a/src/views/common/CommonHover.ts +++ b/src/views/common/CommonHover.ts @@ -4,15 +4,22 @@ const { regClass, property } = Laya; export class CommonHover extends Laya.Script { declare owner : Laya.Box; + @property(Boolean) + public hoverAlpha: boolean = true + onAwake(): void { this.owner.on(Laya.Event.MOUSE_OVER, this, ()=>{ Laya.Render.canvas.style.cursor = "pointer" - this.owner.alpha = 0.7 + if (this.hoverAlpha) { + this.owner.alpha = 0.7 + } }) this.owner.on(Laya.Event.MOUSE_OUT, this, ()=>{ Laya.Render.canvas.style.cursor = "" - this.owner.alpha = 1 + if (this.hoverAlpha) { + this.owner.alpha = 1 + } }) }