From e04152ac930711efa4b82cb4ee09a964f704a373 Mon Sep 17 00:00:00 2001 From: AngryPowman Date: Sat, 15 Aug 2020 02:55:32 +0800 Subject: [PATCH] remove Live2D --- angular.json | 1 - src/engine/core/graphics/sprite-animate-director.ts | 9 +++++---- src/engine/core/graphics/sprite.ts | 2 +- src/engine/core/graphics/world.ts | 3 ++- src/engine/data/sprite-renderer.ts | 4 ++-- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/angular.json b/angular.json index 82f08e7..8bdd193 100644 --- a/angular.json +++ b/angular.json @@ -34,7 +34,6 @@ ], "styles": ["src/styles.scss"], "scripts": [ - "src/app/common/live2d/lib/live2d.min.js", "node_modules/jquery/dist/jquery.min.js" ] }, diff --git a/src/engine/core/graphics/sprite-animate-director.ts b/src/engine/core/graphics/sprite-animate-director.ts index 5363bcb..84eebea 100644 --- a/src/engine/core/graphics/sprite-animate-director.ts +++ b/src/engine/core/graphics/sprite-animate-director.ts @@ -1,5 +1,5 @@ import * as gsap from "gsap"; -import { Sprite } from "./sprite"; +import { Sprite, AnimatedPropertyKeys } from "./sprite"; import { Scene } from "./scene"; import { isNullOrUndefined } from "../utils"; import { SpriteFilter } from "engine/data/sprite-renderer"; @@ -14,15 +14,15 @@ export enum AnimateTargetType { class MacroFrame { duration?: number = 0; + ease?: gsap.Ease; + [key: string]: any; } class SpriteMacroFrame extends MacroFrame { - [key: string]: any; filters?: SpriteFilter[] = []; } class CSSMacroFrame extends MacroFrame { - [key: string]: any; } class CameraMacroFrame extends MacroFrame { @@ -198,7 +198,8 @@ export class SpriteAnimateDirector { let duration = (frame.duration || 1) / 1000; const { ...vars } = frame; - vars.ease = vars.ease || gsap.Power0.easeNone; + + vars.ease = vars.ease || gsap.Power0.ease; // 把相关属性直接设置到 target(sprite) timeline.add( diff --git a/src/engine/core/graphics/sprite.ts b/src/engine/core/graphics/sprite.ts index fab9df5..52ea818 100644 --- a/src/engine/core/graphics/sprite.ts +++ b/src/engine/core/graphics/sprite.ts @@ -16,7 +16,7 @@ export enum ResizeMode { Custom // 自定义大小 } -type AnimatedPropertyKeys = +export type AnimatedPropertyKeys = | "scale" | "scaleX" | "scaleY" diff --git a/src/engine/core/graphics/world.ts b/src/engine/core/graphics/world.ts index 0d5bf51..3d5ced0 100644 --- a/src/engine/core/graphics/world.ts +++ b/src/engine/core/graphics/world.ts @@ -36,7 +36,8 @@ class World { this.app = new PIXI.Application({ width, height, - antialias: false, + forceFXAA: true, + antialias: true, preserveDrawingBuffer: true, transparent: true, backgroundColor: 0, diff --git a/src/engine/data/sprite-renderer.ts b/src/engine/data/sprite-renderer.ts index 55ccf9f..51723bb 100644 --- a/src/engine/data/sprite-renderer.ts +++ b/src/engine/data/sprite-renderer.ts @@ -24,8 +24,8 @@ export class AVGSpriteRenderer { ); // 修正 X, Y - this.x = +this._position.left; - this.y = +this._position.right; + this.x = +this._position.left + this.y = +this._position.right } public get position() {