You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
705 B
37 lines
705 B
import { SpriteEntity } from "./sprite_entity";
|
|
|
|
export class VideoEntity {
|
|
version = "2.0.0";
|
|
|
|
videoSize: {
|
|
width: number;
|
|
height: number;
|
|
};
|
|
|
|
FPS: number;
|
|
|
|
frames: number;
|
|
|
|
sprites: SpriteEntity[];
|
|
|
|
audios: any[];
|
|
|
|
decodedImages: { [key: string]: any } = {};
|
|
|
|
constructor(
|
|
readonly spec: any
|
|
) {
|
|
this.version = spec.ver;
|
|
this.videoSize = {
|
|
width: spec.params.viewBoxWidth || 0.0,
|
|
height: spec.params.viewBoxHeight || 0.0,
|
|
};
|
|
this.FPS = spec.params.fps || 20;
|
|
this.frames = spec.params.frames || 0;
|
|
this.sprites =
|
|
spec.sprites?.map((obj: any) => {
|
|
return new SpriteEntity(obj);
|
|
}) ?? [];
|
|
this.audios = [];
|
|
}
|
|
}
|
|
|