From 6e797f9665af1723c650ac0c9eca0c0943a3bc18 Mon Sep 17 00:00:00 2001 From: yangwen Date: Mon, 9 Jun 2025 21:17:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E5=8A=A0=E5=88=86=E5=8A=A8?= =?UTF-8?q?=E7=94=BB=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/resources/ScoreAdd.lh | 115 ++++++++++++++++++--------- assets/resources/ScoreAdd.lh.meta | 2 +- assets/resources/ScoreAdd_H.lh | 119 ++++++++++++++++++---------- assets/resources/ScoreAdd_H.lh.meta | 2 +- src/views/ScoreAdd.ts | 9 +++ 5 files changed, 167 insertions(+), 80 deletions(-) diff --git a/assets/resources/ScoreAdd.lh b/assets/resources/ScoreAdd.lh index 6852c00..b91b8d2 100644 --- a/assets/resources/ScoreAdd.lh +++ b/assets/resources/ScoreAdd.lh @@ -1,62 +1,101 @@ { "_$ver": 1, - "_$id": "w86l3m5x", - "_$type": "Box", + "_$id": "qp8p7kt2", + "_$type": "Panel", "name": "ScoreAdd", - "width": 116, - "height": 116, + "x": 340, + "y": 760, + "width": 400, + "height": 400, "centerX": 0, "centerY": 0, "_$comp": [ { "_$type": "bdb0e671-99fa-47a5-9101-7ec008b1d25d", "scriptPath": "../src/views/common/AutoDestroy.ts", - "lifeTime": 2 + "lifeTime": 1 }, { "_$type": "c910a064-d127-442e-a884-b5289c488647", "scriptPath": "../src/views/ScoreAdd.ts", + "shadow": { + "_$ref": "jbc42ybp" + }, "label": { - "_$ref": "2eibhgkk" + "_$ref": "84q009kl" } } ], "_$child": [ { - "_$id": "2eibhgkk", - "_$type": "Label", - "name": "Label", - "x": 55, - "y": -42, - "width": 200, - "height": 60, - "anchorX": 0.5, - "anchorY": 0.5, - "alpha": 1, - "_filters": [ + "_$id": "m50hoany", + "_$type": "Box", + "name": "offset", + "x": 142, + "y": 142, + "width": 116, + "height": 116, + "centerX": 0, + "centerY": 0, + "_$child": [ { - "_$type": "GlowFilter", - "offX": 0, - "offY": 6, - "blur": 18, - "color": "rgba(164, 164, 164, 1)" + "_$id": "jbc42ybp", + "_$type": "Label", + "name": "shadow", + "x": 55, + "y": -42, + "width": 200, + "height": 60, + "anchorX": 0.5, + "anchorY": 0.5, + "alpha": 0.18, + "_filters": [ + { + "_$type": "GlowFilter", + "offX": 0, + "offY": 6, + "blur": 18, + "color": "rgba(0, 0, 0, 1)" + } + ], + "centerX": -3, + "text": "+150", + "font": "res://7322bbf9-175b-4a25-a0d7-72d369894de2", + "fontSize": 60, + "color": "rgba(29, 92, 220, 1)", + "bold": true, + "align": "center", + "valign": "middle", + "padding": "0,0,0,0", + "underlineColor": "rgba(255, 255, 255, 1)", + "stroke": 16, + "strokeColor": "rgba(255, 255, 255, 1)" + }, + { + "_$id": "84q009kl", + "_$type": "Label", + "name": "label", + "x": 55, + "y": -42, + "width": 200, + "height": 60, + "anchorX": 0.5, + "anchorY": 0.5, + "_filters": [], + "centerX": -3, + "text": "+150", + "font": "res://7322bbf9-175b-4a25-a0d7-72d369894de2", + "fontSize": 60, + "color": "rgba(29, 92, 220, 1)", + "bold": true, + "align": "center", + "valign": "middle", + "padding": "0,0,0,0", + "underlineColor": "rgba(255, 255, 255, 1)", + "stroke": 16, + "strokeColor": "rgba(255, 255, 255, 1)" } - ], - "centerX": -3, - "text": "+150", - "font": "res://7322bbf9-175b-4a25-a0d7-72d369894de2", - "fontSize": 60, - "color": "rgba(29, 92, 220, 1)", - "bold": true, - "italic": false, - "underline": false, - "strikethrough": false, - "align": "center", - "valign": "middle", - "padding": "0,0,0,0", - "underlineColor": "rgba(255, 255, 255, 1)", - "stroke": 16, - "strokeColor": "rgba(255, 255, 255, 1)" + ] } ] } \ No newline at end of file diff --git a/assets/resources/ScoreAdd.lh.meta b/assets/resources/ScoreAdd.lh.meta index 53954df..7a42cba 100644 --- a/assets/resources/ScoreAdd.lh.meta +++ b/assets/resources/ScoreAdd.lh.meta @@ -1,3 +1,3 @@ { - "uuid": "cc3e3def-73ab-4c93-91ca-15fe9360c857" + "uuid": "a6888ac8-9ecc-4be9-8083-88d536e334df" } \ No newline at end of file diff --git a/assets/resources/ScoreAdd_H.lh b/assets/resources/ScoreAdd_H.lh index 283b69f..ddb336d 100644 --- a/assets/resources/ScoreAdd_H.lh +++ b/assets/resources/ScoreAdd_H.lh @@ -1,60 +1,99 @@ { "_$ver": 1, - "_$id": "r3lhk79l", - "_$type": "Box", + "_$id": "92hrkiys", + "_$type": "Panel", "name": "ScoreAdd_H", - "x": 915, - "y": 495, - "width": 90, - "height": 90, - "drawCallOptimize": true, + "x": -155, + "y": -155, + "width": 400, + "height": 400, "centerX": 0, "centerY": 0, "_$comp": [ - { - "_$type": "bdb0e671-99fa-47a5-9101-7ec008b1d25d", - "scriptPath": "../src/views/common/AutoDestroy.ts", - "lifeTime": 2 - }, { "_$type": "c910a064-d127-442e-a884-b5289c488647", "scriptPath": "../src/views/ScoreAdd.ts", + "shadow": { + "_$ref": "3o1c6tto" + }, "label": { - "_$ref": "4337viuh" + "_$ref": "lyvq5xfn" } + }, + { + "_$type": "bdb0e671-99fa-47a5-9101-7ec008b1d25d", + "scriptPath": "../src/views/common/AutoDestroy.ts", + "lifeTime": 1 } ], "_$child": [ { - "_$id": "4337viuh", - "_$type": "Label", - "name": "Label", - "x": 42, - "y": -42, - "width": 200, - "height": 45, - "anchorX": 0.5, - "anchorY": 0.5, - "_filters": [ + "_$id": "4yn55zcj", + "_$type": "Box", + "name": "offset", + "x": 155, + "y": 155, + "width": 90, + "height": 90, + "centerX": 0, + "centerY": 0, + "_$child": [ { - "_$type": "GlowFilter", - "offX": 0, - "offY": 6, - "blur": 18, - "color": "rgba(164, 164, 164, 1)" + "_$id": "3o1c6tto", + "_$type": "Label", + "name": "shadow", + "x": 45, + "y": -42, + "width": 200, + "height": 45, + "anchorX": 0.5, + "anchorY": 0.5, + "alpha": 0.18, + "_filters": [ + { + "_$type": "GlowFilter", + "offX": 0, + "offY": 6, + "blur": 18, + "color": "rgba(0, 0, 0, 1)" + } + ], + "centerX": 0, + "text": "+150", + "font": "res://7322bbf9-175b-4a25-a0d7-72d369894de2", + "fontSize": 45, + "color": "rgba(29, 92, 220, 1)", + "bold": true, + "align": "center", + "valign": "middle", + "padding": "0,0,0,0", + "stroke": 16, + "strokeColor": "rgba(255, 255, 255, 1)" + }, + { + "_$id": "lyvq5xfn", + "_$type": "Label", + "name": "label", + "x": 45, + "y": -42, + "width": 200, + "height": 45, + "anchorX": 0.5, + "anchorY": 0.5, + "_filters": [], + "centerX": 0, + "text": "+150", + "font": "res://7322bbf9-175b-4a25-a0d7-72d369894de2", + "fontSize": 45, + "color": "rgba(29, 92, 220, 1)", + "bold": true, + "align": "center", + "valign": "middle", + "padding": "0,0,0,0", + "stroke": 16, + "strokeColor": "rgba(255, 255, 255, 1)" } - ], - "centerX": -3, - "text": "+150", - "font": "res://7322bbf9-175b-4a25-a0d7-72d369894de2", - "fontSize": 45, - "color": "rgba(29, 92, 220, 1)", - "bold": true, - "align": "center", - "valign": "middle", - "padding": "0,0,0,0", - "stroke": 16, - "strokeColor": "rgba(255, 255, 255, 1)" + ] } ] } \ No newline at end of file diff --git a/assets/resources/ScoreAdd_H.lh.meta b/assets/resources/ScoreAdd_H.lh.meta index 31227df..04f4fe7 100644 --- a/assets/resources/ScoreAdd_H.lh.meta +++ b/assets/resources/ScoreAdd_H.lh.meta @@ -1,3 +1,3 @@ { - "uuid": "79c5a2f1-0c0d-484c-ad6f-f31b3f3fcbd2" + "uuid": "44b37e5b-1d00-4f14-8362-1921afd5fce8" } \ No newline at end of file diff --git a/src/views/ScoreAdd.ts b/src/views/ScoreAdd.ts index 2af7405..955d429 100644 --- a/src/views/ScoreAdd.ts +++ b/src/views/ScoreAdd.ts @@ -8,10 +8,15 @@ const { regClass, property } = Laya export class ScoreAdd extends Laya.Script { declare owner: Laya.Box + @property(Laya.Label) + public shadow: Laya.Label + @property(Laya.Label) public label: Laya.Label onAwake(): void { + this.shadow.scaleX = 0 + this.shadow.scaleY = 0 this.label.scaleX = 0 this.label.scaleY = 0 @@ -29,9 +34,13 @@ export class ScoreAdd extends Laya.Script { const p = bezier(t / d) return c * p + b } + Laya.Tween.to(this.shadow, { scaleX: 1, scaleY: 1 }, 300, bezierEaseLaya1, null, 0) Laya.Tween.to(this.label, { scaleX: 1, scaleY: 1 }, 300, bezierEaseLaya1, null, 0) + Laya.Tween.to(this.shadow, { y: -102 }, 300, Utility_EaseOut, null, 500) Laya.Tween.to(this.label, { y: -102 }, 300, Utility_EaseOut, null, 500) + + Laya.Tween.to(this.shadow, { alpha: 0 }, 300, Utility_EaseOut, null, 500) Laya.Tween.to(this.label, { alpha: 0 }, 300, Utility_EaseOut, null, 500) // Laya.Tween.to(this.label, { scaleX: 1, scaleY: 1 }, 300, Laya.Ease.bounceIn, null, 0)