add perspective for rotattionX and rotationY

This commit is contained in:
pengfei.zhou
2020-06-03 14:53:32 +08:00
committed by osborn
parent c14ec1954e
commit 9b181830fc
17 changed files with 449 additions and 26 deletions

21
doric-js/index.d.ts vendored
View File

@@ -233,6 +233,11 @@ declare module 'doric/lib/src/ui/view' {
* In Y
*/
rotationY?: number;
/**
* Determines the distance between the z=0 plane and the user in order to give a 3D-positioned element some perspective.
* Default is 200
*/
perspective?: number;
/**
* Only affected when its superview or itself is FlexLayout.
*/
@@ -279,7 +284,7 @@ declare module 'doric/lib/src/ui/panel' {
declare module 'doric/lib/src/ui/animation' {
import { Modeling, Model } from "doric/lib/src/util/types";
export type AnimatedKey = "translationX" | "translationY" | "scaleX" | "scaleY" | "rotation" | "pivotX" | "pivotY";
export type AnimatedKey = "translationX" | "translationY" | "scaleX" | "scaleY" | "rotation" | "pivotX" | "pivotY" | "rotationX" | "rotationY";
export enum RepeatMode {
RESTART = 1,
REVERSE = 2
@@ -387,6 +392,20 @@ declare module 'doric/lib/src/ui/animation' {
set toRotation(v: number);
get toRotation(): number;
}
export class RotationXAnimation extends Animation {
constructor();
set fromRotation(v: number);
get fromRotation(): number;
set toRotation(v: number);
get toRotation(): number;
}
export class RotationYAnimation extends Animation {
constructor();
set fromRotation(v: number);
get fromRotation(): number;
set toRotation(v: number);
get toRotation(): number;
}
export class AnimationSet implements IAnimation {
delay?: number;
addAnimation(anim: IAnimation): void;