补充加分动画细节

This commit is contained in:
2025-06-09 21:17:53 +08:00
parent 5814a2639c
commit 6e797f9665
5 changed files with 167 additions and 80 deletions

View File

@@ -1,45 +1,61 @@
{
"_$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",
"_$id": "m50hoany",
"_$type": "Box",
"name": "offset",
"x": 142,
"y": 142,
"width": 116,
"height": 116,
"centerX": 0,
"centerY": 0,
"_$child": [
{
"_$id": "jbc42ybp",
"_$type": "Label",
"name": "Label",
"name": "shadow",
"x": 55,
"y": -42,
"width": 200,
"height": 60,
"anchorX": 0.5,
"anchorY": 0.5,
"alpha": 1,
"alpha": 0.18,
"_filters": [
{
"_$type": "GlowFilter",
"offX": 0,
"offY": 6,
"blur": 18,
"color": "rgba(164, 164, 164, 1)"
"color": "rgba(0, 0, 0, 1)"
}
],
"centerX": -3,
@@ -48,9 +64,30 @@
"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)"
},
{
"_$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",
@@ -59,4 +96,6 @@
"strokeColor": "rgba(255, 255, 255, 1)"
}
]
}
]
}

View File

@@ -1,3 +1,3 @@
{
"uuid": "cc3e3def-73ab-4c93-91ca-15fe9360c857"
"uuid": "a6888ac8-9ecc-4be9-8083-88d536e334df"
}

View File

@@ -1,50 +1,87 @@
{
"_$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",
"_$id": "4yn55zcj",
"_$type": "Box",
"name": "offset",
"x": 155,
"y": 155,
"width": 90,
"height": 90,
"centerX": 0,
"centerY": 0,
"_$child": [
{
"_$id": "3o1c6tto",
"_$type": "Label",
"name": "Label",
"x": 42,
"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(164, 164, 164, 1)"
"color": "rgba(0, 0, 0, 1)"
}
],
"centerX": -3,
"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,
@@ -57,4 +94,6 @@
"strokeColor": "rgba(255, 255, 255, 1)"
}
]
}
]
}

View File

@@ -1,3 +1,3 @@
{
"uuid": "79c5a2f1-0c0d-484c-ad6f-f31b3f3fcbd2"
"uuid": "44b37e5b-1d00-4f14-8362-1921afd5fce8"
}

View File

@@ -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)