evotars 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +13 -0
- package/.prettierrc.json +3 -0
- package/README.md +3 -5
- package/index.html +13 -0
- package/package.json +3 -16
- package/playground/main.ts +48 -0
- package/playground/styles.css +17 -0
- package/public/evotars/agent/data.json +18 -0
- package/public/evotars/agent/sprite.json +166 -0
- package/public/evotars/agent/sprite.png +0 -0
- package/public/evotars/cat/data.json +18 -0
- package/public/evotars/cat/sprite.json +231 -0
- package/public/evotars/cat/sprite.png +0 -0
- package/public/evotars/dude/data.json +18 -0
- package/public/evotars/dude/sprite.json +231 -0
- package/public/evotars/dude/sprite.png +0 -0
- package/public/evotars/girl/data.json +18 -0
- package/public/evotars/girl/sprite.json +231 -0
- package/public/evotars/girl/sprite.png +0 -0
- package/public/evotars/nerd/data.json +18 -0
- package/public/evotars/nerd/sprite.json +231 -0
- package/public/evotars/nerd/sprite.png +0 -0
- package/public/evotars/senior/data.json +18 -0
- package/public/evotars/senior/sprite.json +231 -0
- package/public/evotars/senior/sprite.png +0 -0
- package/public/evotars/set.json +10 -0
- package/public/evotars/sith/data.json +18 -0
- package/public/evotars/sith/sprite.json +166 -0
- package/public/evotars/sith/sprite.png +0 -0
- package/public/evotars/sponge/data.json +18 -0
- package/public/evotars/sponge/sprite.json +231 -0
- package/public/evotars/sponge/sprite.png +0 -0
- package/public/fonts/Rubik.ttf +0 -0
- package/public/sounds/jump.mp3 +0 -0
- package/src/app.ts +71 -0
- package/src/config/constants.ts +1 -0
- package/src/entities/EmoteSpitter.ts +102 -0
- package/src/entities/Evotar.ts +468 -0
- package/src/entities/Message.ts +164 -0
- package/src/entities/Name.ts +33 -0
- package/src/entities/SpriteContainer.ts +65 -0
- package/src/entities/TrailEffect.ts +73 -0
- package/src/evotars.ts +75 -0
- package/src/evotarsManager.ts +313 -0
- package/src/helpers/timer.ts +43 -0
- package/src/helpers/types.ts +4 -0
- package/src/services/soundService.ts +30 -0
- package/src/services/spriteService.ts +167 -0
- package/src/types/dto/action.ts +79 -0
- package/{dist/types/dto/chatter.d.ts → src/types/dto/chatter.ts} +2 -2
- package/src/types/dto/event.ts +9 -0
- package/src/types/dto/message.ts +8 -0
- package/src/types/dto/settings.ts +5 -0
- package/src/types/dto/user.ts +13 -0
- package/tsconfig.json +23 -0
- package/vite.config.js +26 -0
- package/dist/app.d.ts +0 -24
- package/dist/config/constants.d.ts +0 -1
- package/dist/entities/EmoteSpitter.d.ts +0 -15
- package/dist/entities/Evotar.d.ts +0 -78
- package/dist/entities/Message.d.ts +0 -27
- package/dist/entities/Name.d.ts +0 -14
- package/dist/entities/SpriteContainer.d.ts +0 -16
- package/dist/entities/TrailEffect.d.ts +0 -15
- package/dist/evotars.d.ts +0 -15
- package/dist/evotars.js +0 -705
- package/dist/evotars.umd.cjs +0 -1
- package/dist/evotarsManager.d.ts +0 -30
- package/dist/helpers/timer.d.ts +0 -14
- package/dist/helpers/types.d.ts +0 -10
- package/dist/services/soundService.d.ts +0 -14
- package/dist/services/spriteService.d.ts +0 -63
- package/dist/types/dto/action.d.ts +0 -56
- package/dist/types/dto/event.d.ts +0 -9
- package/dist/types/dto/message.d.ts +0 -8
- package/dist/types/dto/settings.d.ts +0 -5
- package/dist/types/dto/user.d.ts +0 -12
- /package/{dist/index.d.ts → src/index.ts} +0 -0
- /package/{dist/types/dto/index.d.ts → src/types/dto/index.ts} +0 -0
- /package/{dist/types/index.d.ts → src/types/index.ts} +0 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AnimatedSprite,
|
|
3
|
+
Assets,
|
|
4
|
+
ISpritesheetData,
|
|
5
|
+
ISpritesheetFrameData,
|
|
6
|
+
SCALE_MODES,
|
|
7
|
+
Spritesheet,
|
|
8
|
+
} from 'pixi.js';
|
|
9
|
+
|
|
10
|
+
export type EvotarSpriteData = {
|
|
11
|
+
name: string;
|
|
12
|
+
collider: Collider;
|
|
13
|
+
size: SpriteSize;
|
|
14
|
+
scale: number;
|
|
15
|
+
flip: boolean;
|
|
16
|
+
colored: string[];
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type SpriteLoaderFn = (name: string) => Promise<
|
|
20
|
+
| {
|
|
21
|
+
sprite: SpritesheetData;
|
|
22
|
+
data: EvotarSpriteData;
|
|
23
|
+
image: string;
|
|
24
|
+
}
|
|
25
|
+
| undefined
|
|
26
|
+
>;
|
|
27
|
+
|
|
28
|
+
export type Collider = {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
w: number;
|
|
32
|
+
h: number;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export interface SpritesheetFrameData extends ISpritesheetFrameData {
|
|
36
|
+
duration: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface SpritesheetData extends ISpritesheetData {
|
|
40
|
+
frames: Record<string, SpritesheetFrameData>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type EvotarLayerSprites = {
|
|
44
|
+
[layer in string]: AnimatedSprite;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export type EvotarAnimatedSprites = {
|
|
48
|
+
[tag in string]: EvotarLayerSprites;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export enum EvotarSpriteTags {
|
|
52
|
+
Idle = 'Idle',
|
|
53
|
+
Jump = 'Jump',
|
|
54
|
+
Fall = 'Fall',
|
|
55
|
+
Land = 'Land',
|
|
56
|
+
Run = 'Run',
|
|
57
|
+
Die = 'Die',
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export type FrameTag = {
|
|
61
|
+
from: number;
|
|
62
|
+
name: string;
|
|
63
|
+
to: number;
|
|
64
|
+
direction: string;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export type SpriteSize = {
|
|
68
|
+
w: number;
|
|
69
|
+
h: number;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export type SpriteData = {
|
|
73
|
+
sheet: Spritesheet<SpritesheetData>;
|
|
74
|
+
data: EvotarSpriteData;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export class SpriteService {
|
|
78
|
+
private spriteLoaderFn!: SpriteLoaderFn;
|
|
79
|
+
|
|
80
|
+
private sprites: Record<string, SpriteData> = {};
|
|
81
|
+
|
|
82
|
+
public initialize(spriteLoaderFn: SpriteLoaderFn) {
|
|
83
|
+
this.spriteLoaderFn = spriteLoaderFn;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
public async getSpriteData(name: string): Promise<SpriteData | undefined> {
|
|
87
|
+
const sprite = await this.spriteLoaderFn(name);
|
|
88
|
+
|
|
89
|
+
if (!sprite) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (this.sprites[name]) {
|
|
94
|
+
return this.sprites[name];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const texture = await Assets.load(sprite.image);
|
|
98
|
+
|
|
99
|
+
const sheet = new Spritesheet({
|
|
100
|
+
texture,
|
|
101
|
+
data: sprite.sprite,
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
await sheet.parse();
|
|
105
|
+
|
|
106
|
+
this.sprites[name] = {
|
|
107
|
+
sheet,
|
|
108
|
+
data: {
|
|
109
|
+
...sprite.data,
|
|
110
|
+
scale: sprite.data.scale ?? 1,
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
return this.sprites[name];
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
public getAnimatedSprites(name: string): EvotarAnimatedSprites {
|
|
118
|
+
if (!name) {
|
|
119
|
+
throw Error('Sheet is not defined');
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (!this.sprites[name]) {
|
|
123
|
+
throw Error('Sprite is not loaded');
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const data = this.sprites[name].data;
|
|
127
|
+
const sheet = this.sprites[name].sheet;
|
|
128
|
+
|
|
129
|
+
const sprites: EvotarAnimatedSprites = {};
|
|
130
|
+
|
|
131
|
+
for (const frameTag of sheet.data.meta.frameTags ?? []) {
|
|
132
|
+
if (!sheet.data.meta.layers) {
|
|
133
|
+
throw Error('Layers are not defined');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const layers: EvotarLayerSprites = {};
|
|
137
|
+
|
|
138
|
+
for (const layer of sheet.data.meta.layers) {
|
|
139
|
+
const textures = [];
|
|
140
|
+
|
|
141
|
+
for (let i = frameTag.from; i <= frameTag.to; i++) {
|
|
142
|
+
const framekey = i.toString();
|
|
143
|
+
|
|
144
|
+
const key = data.name + '_' + layer.name + '_' + framekey;
|
|
145
|
+
const texture = sheet.textures[key];
|
|
146
|
+
const time = sheet.data.frames[key].duration;
|
|
147
|
+
|
|
148
|
+
textures.push({ texture: texture, time: time });
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const sprite = new AnimatedSprite(textures);
|
|
152
|
+
|
|
153
|
+
sprite.texture.baseTexture.scaleMode = SCALE_MODES.NEAREST;
|
|
154
|
+
|
|
155
|
+
layers[layer.name] = sprite;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (frameTag.name) {
|
|
159
|
+
sprites[frameTag.name] = layers;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return sprites;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export const spriteService = new SpriteService();
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { UserInfo } from './user';
|
|
2
|
+
|
|
3
|
+
export type ActionData = Record<string, string | number | undefined>;
|
|
4
|
+
|
|
5
|
+
export type ActionableData = {
|
|
6
|
+
arguments: string[];
|
|
7
|
+
action: ActionData;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type ActionEntity = {
|
|
11
|
+
id: number;
|
|
12
|
+
name: string;
|
|
13
|
+
title: string;
|
|
14
|
+
description: string;
|
|
15
|
+
data: ActionData;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type UserActionEntity = {
|
|
19
|
+
userId: string;
|
|
20
|
+
cooldown: number;
|
|
21
|
+
info: UserInfo;
|
|
22
|
+
} & ActionEntity;
|
|
23
|
+
|
|
24
|
+
export type JumpUserActionEntity = {
|
|
25
|
+
name: 'jump';
|
|
26
|
+
data: {
|
|
27
|
+
velocityX: number;
|
|
28
|
+
velocityY: number;
|
|
29
|
+
};
|
|
30
|
+
} & UserActionEntity;
|
|
31
|
+
|
|
32
|
+
export type ColorUserActionEntity = {
|
|
33
|
+
name: 'color';
|
|
34
|
+
data: {
|
|
35
|
+
color: string;
|
|
36
|
+
};
|
|
37
|
+
} & UserActionEntity;
|
|
38
|
+
|
|
39
|
+
export type GrowUserActionEntity = {
|
|
40
|
+
name: 'grow';
|
|
41
|
+
data: {
|
|
42
|
+
duration: number;
|
|
43
|
+
scale: number;
|
|
44
|
+
};
|
|
45
|
+
} & UserActionEntity;
|
|
46
|
+
|
|
47
|
+
export type DashUserActionEntity = {
|
|
48
|
+
name: 'dash';
|
|
49
|
+
data: {
|
|
50
|
+
force: number;
|
|
51
|
+
};
|
|
52
|
+
} & UserActionEntity;
|
|
53
|
+
|
|
54
|
+
export type SpriteUserActionEntity = {
|
|
55
|
+
name: 'sprite';
|
|
56
|
+
data: {
|
|
57
|
+
sprite: string;
|
|
58
|
+
};
|
|
59
|
+
} & UserActionEntity;
|
|
60
|
+
|
|
61
|
+
export const isJumpUserActionEntity = (
|
|
62
|
+
entity: ActionEntity,
|
|
63
|
+
): entity is JumpUserActionEntity => entity.name == 'jump';
|
|
64
|
+
|
|
65
|
+
export const isColorUserActionEntity = (
|
|
66
|
+
entity: ActionEntity,
|
|
67
|
+
): entity is ColorUserActionEntity => entity.name == 'color';
|
|
68
|
+
|
|
69
|
+
export const isGrowUserActionEntity = (
|
|
70
|
+
entity: ActionEntity,
|
|
71
|
+
): entity is GrowUserActionEntity => entity.name == 'grow';
|
|
72
|
+
|
|
73
|
+
export const isDashUserActionEntity = (
|
|
74
|
+
entity: ActionEntity,
|
|
75
|
+
): entity is DashUserActionEntity => entity.name == 'dash';
|
|
76
|
+
|
|
77
|
+
export const isSpriteUserActionEntity = (
|
|
78
|
+
entity: ActionEntity,
|
|
79
|
+
): entity is SpriteUserActionEntity => entity.name == 'sprite';
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable", "ES2021.String"],
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
|
|
9
|
+
/* Bundler mode */
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
|
|
16
|
+
/* Linting */
|
|
17
|
+
"strict": true,
|
|
18
|
+
"noUnusedLocals": true,
|
|
19
|
+
"noUnusedParameters": true,
|
|
20
|
+
"noFallthroughCasesInSwitch": true
|
|
21
|
+
},
|
|
22
|
+
"include": ["src"]
|
|
23
|
+
}
|
package/vite.config.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { resolve } from 'path';
|
|
2
|
+
import { defineConfig } from 'vite';
|
|
3
|
+
import dts from 'vite-plugin-dts';
|
|
4
|
+
import pkg from './package.json' assert { type: 'json' };
|
|
5
|
+
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
plugins: [dts()],
|
|
8
|
+
build: {
|
|
9
|
+
lib: {
|
|
10
|
+
entry: resolve(__dirname, 'src/index.ts'),
|
|
11
|
+
name: 'evotars',
|
|
12
|
+
fileName: 'evotars',
|
|
13
|
+
},
|
|
14
|
+
copyPublicDir: false,
|
|
15
|
+
rollupOptions: {
|
|
16
|
+
external: [...Object.keys(pkg.dependencies)],
|
|
17
|
+
output: {
|
|
18
|
+
globals: {
|
|
19
|
+
'pixi.js': 'PIXI',
|
|
20
|
+
tinycolor2: 'tinycolor',
|
|
21
|
+
'@tweenjs/tween.js': 'TWEEN',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
});
|
package/dist/app.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { SpriteLoaderFn } from './services/spriteService';
|
|
2
|
-
import { SettingsEntity } from './types';
|
|
3
|
-
import { SoundOptions } from './services/soundService';
|
|
4
|
-
import { Evotar } from './entities/Evotar';
|
|
5
|
-
import * as PIXI from 'pixi.js';
|
|
6
|
-
export type AppOptions = {
|
|
7
|
-
font?: {
|
|
8
|
-
name: string;
|
|
9
|
-
src?: string;
|
|
10
|
-
};
|
|
11
|
-
sounds?: SoundOptions;
|
|
12
|
-
spriteLoaderFn: SpriteLoaderFn;
|
|
13
|
-
};
|
|
14
|
-
export declare class App {
|
|
15
|
-
stage: PIXI.Container;
|
|
16
|
-
evotars: Record<string, Evotar>;
|
|
17
|
-
chatterIds: string[];
|
|
18
|
-
settings: SettingsEntity;
|
|
19
|
-
renderer: PIXI.Renderer;
|
|
20
|
-
initialize(element: HTMLElement, options: AppOptions): Promise<void>;
|
|
21
|
-
updateSettings(data: SettingsEntity): void;
|
|
22
|
-
update(): void;
|
|
23
|
-
}
|
|
24
|
-
export declare const app: App;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const FIXED_DELTA_TIME: number;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Point } from '../helpers/types';
|
|
2
|
-
import * as PIXI from 'pixi.js';
|
|
3
|
-
export type EvotarEmoteSpitterProps = {
|
|
4
|
-
position: Point;
|
|
5
|
-
};
|
|
6
|
-
export declare class EvotarEmoteSpitter {
|
|
7
|
-
container: PIXI.Container;
|
|
8
|
-
private emotes;
|
|
9
|
-
private moveSpeed;
|
|
10
|
-
private alphaSpeed;
|
|
11
|
-
private scaleSpeed;
|
|
12
|
-
private timer?;
|
|
13
|
-
add(url: string): void;
|
|
14
|
-
update(props: EvotarEmoteSpitterProps): void;
|
|
15
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { EvotarTrailEffect } from './TrailEffect';
|
|
2
|
-
import { EvotarSpriteTags } from '../services/spriteService';
|
|
3
|
-
import { Timer } from '../helpers/timer';
|
|
4
|
-
import * as TWEEN from '@tweenjs/tween.js';
|
|
5
|
-
import * as PIXI from 'pixi.js';
|
|
6
|
-
export type EvotarProps = {
|
|
7
|
-
name?: string;
|
|
8
|
-
sprite?: string;
|
|
9
|
-
color?: PIXI.Color;
|
|
10
|
-
direction?: number;
|
|
11
|
-
scale?: number;
|
|
12
|
-
isAnonymous?: boolean;
|
|
13
|
-
zIndex?: number;
|
|
14
|
-
};
|
|
15
|
-
export type EvotarSpawnProps = {
|
|
16
|
-
isFalling?: boolean;
|
|
17
|
-
positionX?: number;
|
|
18
|
-
onComplete?: () => void;
|
|
19
|
-
};
|
|
20
|
-
export type EvotarDepawnProps = {
|
|
21
|
-
onComplete?: () => void;
|
|
22
|
-
};
|
|
23
|
-
type UserProps = {
|
|
24
|
-
color?: PIXI.Color;
|
|
25
|
-
};
|
|
26
|
-
export declare class Evotar {
|
|
27
|
-
container: PIXI.Container;
|
|
28
|
-
private userState;
|
|
29
|
-
private state;
|
|
30
|
-
private animationState;
|
|
31
|
-
private sprite?;
|
|
32
|
-
private spriteData;
|
|
33
|
-
private animatedSprites?;
|
|
34
|
-
trail: EvotarTrailEffect;
|
|
35
|
-
private name;
|
|
36
|
-
private message;
|
|
37
|
-
private emoteSpitter;
|
|
38
|
-
private velocity;
|
|
39
|
-
private runSpeed;
|
|
40
|
-
private gravity;
|
|
41
|
-
private dashAcc;
|
|
42
|
-
private isJumping;
|
|
43
|
-
private isDashing;
|
|
44
|
-
private isDespawned;
|
|
45
|
-
landTimer?: Timer;
|
|
46
|
-
stateTimer?: Timer;
|
|
47
|
-
scaleTimer?: Timer;
|
|
48
|
-
spawnTween?: TWEEN.Tween<PIXI.Container>;
|
|
49
|
-
fadeTween?: TWEEN.Tween<PIXI.Container>;
|
|
50
|
-
scaleTween?: TWEEN.Tween<Evotar>;
|
|
51
|
-
constructor();
|
|
52
|
-
spawn(props?: EvotarSpawnProps): void;
|
|
53
|
-
despawn(props?: EvotarDepawnProps): void;
|
|
54
|
-
scale(options: {
|
|
55
|
-
value: number;
|
|
56
|
-
duration: number;
|
|
57
|
-
cooldown: number;
|
|
58
|
-
}): void;
|
|
59
|
-
jump(options: {
|
|
60
|
-
velocityX: number;
|
|
61
|
-
velocityY: number;
|
|
62
|
-
cooldown: number;
|
|
63
|
-
}): void;
|
|
64
|
-
dash(options: {
|
|
65
|
-
force: number;
|
|
66
|
-
cooldown: number;
|
|
67
|
-
}): void;
|
|
68
|
-
setSprite(sprite: string): Promise<void>;
|
|
69
|
-
setProps(props: EvotarProps): Promise<void>;
|
|
70
|
-
setUserProps(props: UserProps): void;
|
|
71
|
-
private move;
|
|
72
|
-
update(): void;
|
|
73
|
-
isOnGround(y: number): boolean;
|
|
74
|
-
addMessage(message: string): void;
|
|
75
|
-
spitEmotes(emotes: string[]): void;
|
|
76
|
-
setAnimationState(state: EvotarSpriteTags, force?: boolean): Promise<void>;
|
|
77
|
-
}
|
|
78
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Point } from '../helpers/types';
|
|
2
|
-
|
|
3
|
-
import * as PIXI from 'pixi.js';
|
|
4
|
-
export type EvotarMesageProps = {
|
|
5
|
-
position: Point;
|
|
6
|
-
};
|
|
7
|
-
export declare class EvotarMessage {
|
|
8
|
-
private beforeShow;
|
|
9
|
-
container: PIXI.Container;
|
|
10
|
-
animated: PIXI.Container;
|
|
11
|
-
private text;
|
|
12
|
-
private padding;
|
|
13
|
-
private borderRadius;
|
|
14
|
-
private boxColor;
|
|
15
|
-
private fadeShift;
|
|
16
|
-
private isChecking;
|
|
17
|
-
private messageQueue;
|
|
18
|
-
private showTween?;
|
|
19
|
-
private hideTween?;
|
|
20
|
-
private timer?;
|
|
21
|
-
constructor(beforeShow: () => void);
|
|
22
|
-
private trim;
|
|
23
|
-
update(props: EvotarMesageProps): void;
|
|
24
|
-
add(message: string): void;
|
|
25
|
-
private drawBox;
|
|
26
|
-
private show;
|
|
27
|
-
}
|
package/dist/entities/Name.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Point, Rect } from '../helpers/types';
|
|
2
|
-
|
|
3
|
-
import * as PIXI from 'pixi.js';
|
|
4
|
-
export type EvotarNameProps = {
|
|
5
|
-
name: string;
|
|
6
|
-
position: Point;
|
|
7
|
-
isVisible: boolean;
|
|
8
|
-
};
|
|
9
|
-
export declare class EvotarName {
|
|
10
|
-
text: PIXI.Text;
|
|
11
|
-
constructor();
|
|
12
|
-
update(props: EvotarNameProps): void;
|
|
13
|
-
rect: () => Rect;
|
|
14
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { EvotarLayerSprites } from '../services/spriteService';
|
|
2
|
-
import { Point } from '../helpers/types';
|
|
3
|
-
import * as PIXI from 'pixi.js';
|
|
4
|
-
export type EvotarSpriteContainerProps = {
|
|
5
|
-
color: {
|
|
6
|
-
[key in string]?: PIXI.Color;
|
|
7
|
-
};
|
|
8
|
-
scale: Point;
|
|
9
|
-
play: boolean;
|
|
10
|
-
};
|
|
11
|
-
export declare class EvotarSpriteContainer {
|
|
12
|
-
container: PIXI.Container;
|
|
13
|
-
sprites: EvotarLayerSprites;
|
|
14
|
-
constructor(sprites: EvotarLayerSprites);
|
|
15
|
-
update(props: EvotarSpriteContainerProps): void;
|
|
16
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { EvotarSpriteContainer } from './SpriteContainer';
|
|
2
|
-
import * as PIXI from 'pixi.js';
|
|
3
|
-
export type EvotarTrailEffectProps = {
|
|
4
|
-
play: boolean;
|
|
5
|
-
};
|
|
6
|
-
export declare class EvotarTrailEffect {
|
|
7
|
-
container: PIXI.Container;
|
|
8
|
-
private timer?;
|
|
9
|
-
private sprite?;
|
|
10
|
-
private opacityStep;
|
|
11
|
-
private shadowStep;
|
|
12
|
-
constructor();
|
|
13
|
-
setSprite(sprite: EvotarSpriteContainer): void;
|
|
14
|
-
update(props: EvotarTrailEffectProps): void;
|
|
15
|
-
}
|
package/dist/evotars.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { MessageEntity, RaidData, SettingsEntity, TwitchChatterEntity, UserActionEntity } from './types';
|
|
2
|
-
import { AppOptions } from './app';
|
|
3
|
-
|
|
4
|
-
export declare class Evotars {
|
|
5
|
-
private readonly root;
|
|
6
|
-
private readonly options;
|
|
7
|
-
private isRendered;
|
|
8
|
-
constructor(root: HTMLElement, options: AppOptions);
|
|
9
|
-
processMessage: (data: MessageEntity) => Promise<void>;
|
|
10
|
-
processAction: (data: UserActionEntity) => Promise<void>;
|
|
11
|
-
processChatters: (data: TwitchChatterEntity[]) => Promise<void>;
|
|
12
|
-
processRaid: (data: RaidData) => void;
|
|
13
|
-
updateSettings(data: SettingsEntity): void;
|
|
14
|
-
run(): Promise<void>;
|
|
15
|
-
}
|