完善加分动画
This commit is contained in:
@@ -32,15 +32,29 @@
|
|||||||
"height": 60,
|
"height": 60,
|
||||||
"anchorX": 0.5,
|
"anchorX": 0.5,
|
||||||
"anchorY": 0.5,
|
"anchorY": 0.5,
|
||||||
|
"alpha": 1,
|
||||||
|
"_filters": [
|
||||||
|
{
|
||||||
|
"_$type": "GlowFilter",
|
||||||
|
"offX": 0,
|
||||||
|
"offY": 6,
|
||||||
|
"blur": 18,
|
||||||
|
"color": "rgba(164, 164, 164, 1)"
|
||||||
|
}
|
||||||
|
],
|
||||||
"centerX": -3,
|
"centerX": -3,
|
||||||
"text": "+150",
|
"text": "+150",
|
||||||
"font": "res://7322bbf9-175b-4a25-a0d7-72d369894de2",
|
"font": "res://7322bbf9-175b-4a25-a0d7-72d369894de2",
|
||||||
"fontSize": 60,
|
"fontSize": 60,
|
||||||
"color": "rgba(29, 92, 220, 1)",
|
"color": "rgba(29, 92, 220, 1)",
|
||||||
"bold": true,
|
"bold": true,
|
||||||
|
"italic": false,
|
||||||
|
"underline": false,
|
||||||
|
"strikethrough": false,
|
||||||
"align": "center",
|
"align": "center",
|
||||||
"valign": "middle",
|
"valign": "middle",
|
||||||
"padding": "0,0,0,0",
|
"padding": "0,0,0,0",
|
||||||
|
"underlineColor": "rgba(255, 255, 255, 1)",
|
||||||
"stroke": 16,
|
"stroke": 16,
|
||||||
"strokeColor": "rgba(255, 255, 255, 1)"
|
"strokeColor": "rgba(255, 255, 255, 1)"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,15 @@
|
|||||||
"height": 45,
|
"height": 45,
|
||||||
"anchorX": 0.5,
|
"anchorX": 0.5,
|
||||||
"anchorY": 0.5,
|
"anchorY": 0.5,
|
||||||
|
"_filters": [
|
||||||
|
{
|
||||||
|
"_$type": "GlowFilter",
|
||||||
|
"offX": 0,
|
||||||
|
"offY": 6,
|
||||||
|
"blur": 18,
|
||||||
|
"color": "rgba(164, 164, 164, 1)"
|
||||||
|
}
|
||||||
|
],
|
||||||
"centerX": -3,
|
"centerX": -3,
|
||||||
"text": "+150",
|
"text": "+150",
|
||||||
"font": "res://7322bbf9-175b-4a25-a0d7-72d369894de2",
|
"font": "res://7322bbf9-175b-4a25-a0d7-72d369894de2",
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { AutoDestroy } from "./common/AutoDestroy"
|
import { AutoDestroy } from "./common/AutoDestroy"
|
||||||
|
import BezierEasing from 'bezier-easing';
|
||||||
|
|
||||||
const { regClass, property } = Laya
|
const { regClass, property } = Laya
|
||||||
|
|
||||||
@@ -18,11 +19,28 @@ export class ScoreAdd extends Laya.Script {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onStart(): void {
|
onStart(): void {
|
||||||
Laya.Tween.to(this.label, { scaleX: 1, scaleY: 1 }, 300, Laya.Ease.bounceIn, null, 0)
|
|
||||||
|
|
||||||
Laya.Tween.to(this.label, { y: -102 }, 300, Laya.Ease.linearOut, null, 500)
|
// const filter: Laya.GlowFilter = new Laya.GlowFilter("#000000", 5, 0, 0);
|
||||||
|
// this.label.filters = [filter];
|
||||||
|
|
||||||
|
function bezierEaseLaya1(t: number, b: number, c: number, d: number) {
|
||||||
|
const bezier = BezierEasing(0.55, 1.8, 0.8, 0.95)
|
||||||
|
const p = bezier(t / d)
|
||||||
|
return c * p + b
|
||||||
|
}
|
||||||
|
Laya.Tween.to(this.label, { scaleX: 1, scaleY: 1 }, 300, bezierEaseLaya1, null, 0)
|
||||||
|
|
||||||
Laya.Tween.to(this.label, { alpha: 0 }, 300, Laya.Ease.linearOut, null, 500)
|
function bezierEaseOut(t: number, b: number, c: number, d: number) {
|
||||||
|
const bezier = BezierEasing(0, 0, 0.58, 1)
|
||||||
|
const p = bezier(t / d)
|
||||||
|
return c * p + b
|
||||||
|
}
|
||||||
|
Laya.Tween.to(this.label, { y: -102 }, 300, bezierEaseOut, null, 500)
|
||||||
|
Laya.Tween.to(this.label, { alpha: 0 }, 300, bezierEaseOut, null, 500)
|
||||||
|
|
||||||
|
// Laya.Tween.to(this.label, { scaleX: 1, scaleY: 1 }, 300, Laya.Ease.bounceIn, null, 0)
|
||||||
|
// Laya.Tween.to(this.label, { y: -102 }, 300, Laya.Ease.linearOut, null, 500)
|
||||||
|
// Laya.Tween.to(this.label, { alpha: 0 }, 300, Laya.Ease.linearOut, null, 500)
|
||||||
}
|
}
|
||||||
|
|
||||||
public onSetText(text: string): void {
|
public onSetText(text: string): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user