workadventure/front/src/types.ts

55 lines
1.5 KiB
TypeScript
Raw Normal View History

import type Phaser from "phaser";
2021-02-03 23:28:46 +01:00
export type CursorKey = {
isDown: boolean;
};
2021-02-03 23:28:46 +01:00
export type Direction = "left" | "right" | "up" | "down";
2021-02-03 23:28:46 +01:00
export interface CursorKeys extends Record<Direction, CursorKey> {
left: CursorKey;
right: CursorKey;
up: CursorKey;
down: CursorKey;
}
export interface IVirtualJoystick extends Phaser.GameObjects.GameObject {
y: number;
x: number;
forceX: number;
forceY: number;
2021-02-03 23:28:46 +01:00
visible: boolean;
createCursorKeys: () => CursorKeys;
}
export enum Easing {
Linear = "Linear",
QuadEaseIn = "Quad.easeIn",
CubicEaseIn = "Cubic.easeIn",
QuartEaseIn = "Quart.easeIn",
QuintEaseIn = "Quint.easeIn",
SineEaseIn = "Sine.easeIn",
ExpoEaseIn = "Expo.easeIn",
CircEaseIn = "Circ.easeIn",
BackEaseIn = "Back.easeIn",
BounceEaseIn = "Bounce.easeIn",
QuadEaseOut = "Quad.easeOut",
CubicEaseOut = "Cubic.easeOut",
QuartEaseOut = "Quart.easeOut",
QuintEaseOut = "Quint.easeOut",
SineEaseOut = "Sine.easeOut",
ExpoEaseOut = "Expo.easeOut",
CircEaseOut = "Circ.easeOut",
BackEaseOut = "Back.easeOut",
BounceEaseOut = "Bounce.easeOut",
QuadEaseInOut = "Quad.easeInOut",
CubicEaseInOut = "Cubic.easeInOut",
QuartEaseInOut = "Quart.easeInOut",
QuintEaseInOut = "Quint.easeInOut",
SineEaseInOut = "Sine.easeInOut",
ExpoEaseInOut = "Expo.easeInOut",
CircEaseInOut = "Circ.easeInOut",
BackEaseInOut = "Back.easeInOut",
2021-12-03 10:11:16 +01:00
BounceEaseInOut = "Bounce.easeInOut",
}