@dcl-sdk/utils
Version:
A collection of helpers to make it easier to build a Decentraland scene using the SDK 7.
46 lines (45 loc) • 2.92 kB
TypeScript
import { Entity, IEngine } from "@dcl/sdk/ecs";
import { InterpolationType } from "./math";
export type OnFinishCallback = () => void;
export type Tweens = ReturnType<typeof createTweens>;
declare function createTweens(targetEngine: IEngine): {
startTranslation: (entity: Entity, start: import("@dcl/sdk/ecs").PBVector3 | undefined, end: import("@dcl/sdk/ecs").PBVector3 | undefined, duration: number, interpolationType?: InterpolationType, onFinish?: OnFinishCallback) => void;
stopTranslation: (entity: Entity) => void;
startRotation: (entity: Entity, start: import("@dcl/sdk/ecs").PBQuaternion | undefined, end: import("@dcl/sdk/ecs").PBQuaternion | undefined, duration: number, interpolationType?: InterpolationType, onFinish?: OnFinishCallback) => void;
stopRotation: (entity: Entity) => void;
startScaling: (entity: Entity, start: import("@dcl/sdk/ecs").PBVector3 | undefined, end: import("@dcl/sdk/ecs").PBVector3 | undefined, duration: number, interpolationType?: InterpolationType, onFinish?: OnFinishCallback) => void;
stopScaling: (entity: Entity) => void;
getTranslationOnFinishCallback: (entity: Entity) => {
normalizedTime: number;
callback: OnFinishCallback | undefined;
} | undefined;
getRotationOnFinishCallback: (entity: Entity) => {
normalizedTime: number;
callback: OnFinishCallback | undefined;
} | undefined;
getScalingOnFinishCallback: (entity: Entity) => {
normalizedTime: number;
callback: OnFinishCallback | undefined;
} | undefined;
};
export declare const tweens: {
startTranslation: (entity: Entity, start: import("@dcl/sdk/ecs").PBVector3 | undefined, end: import("@dcl/sdk/ecs").PBVector3 | undefined, duration: number, interpolationType?: InterpolationType, onFinish?: OnFinishCallback) => void;
stopTranslation: (entity: Entity) => void;
startRotation: (entity: Entity, start: import("@dcl/sdk/ecs").PBQuaternion | undefined, end: import("@dcl/sdk/ecs").PBQuaternion | undefined, duration: number, interpolationType?: InterpolationType, onFinish?: OnFinishCallback) => void;
stopRotation: (entity: Entity) => void;
startScaling: (entity: Entity, start: import("@dcl/sdk/ecs").PBVector3 | undefined, end: import("@dcl/sdk/ecs").PBVector3 | undefined, duration: number, interpolationType?: InterpolationType, onFinish?: OnFinishCallback) => void;
stopScaling: (entity: Entity) => void;
getTranslationOnFinishCallback: (entity: Entity) => {
normalizedTime: number;
callback: OnFinishCallback | undefined;
} | undefined;
getRotationOnFinishCallback: (entity: Entity) => {
normalizedTime: number;
callback: OnFinishCallback | undefined;
} | undefined;
getScalingOnFinishCallback: (entity: Entity) => {
normalizedTime: number;
callback: OnFinishCallback | undefined;
} | undefined;
};
export {};