djmisterjon

Hi , maybe i do a mistake , but why interface are all Required and not Partial ?
export interface SpinePlayerConfig {
jsonUrl: string;
jsonField: string;
binaryUrl: string;
atlasUrl: string;
rawDataURIs: StringMap<string>;
animation: string;
animations: string[];
defaultMix: number;
skin: string;
skins: string[];
premultipliedAlpha: boolean;
showControls: boolean;
showLoading: boolean;
debug: {
bones: boolean;
regions: boolean;
meshes: boolean;
bounds: boolean;
paths: boolean;
clipping: boolean;
points: boolean;
hulls: boolean;
};
viewport: {
x: number;
y: number;
width: number;
height: number;
padLeft: string | number;
padRight: string | number;
padTop: string | number;
padBottom: string | number;
debugRender: boolean;
transitionTime: number;
animations: StringMap<Viewport>;
};
alpha: boolean;
backgroundColor: string;
fullScreenBackgroundColor: string;
backgroundImage: {
url: string;
x: number;
y: number;
width: number;
height: number;
};
mipmaps: true;
controlBones: string[];
success: (player: SpinePlayer) => void;
error: (player: SpinePlayer, msg: string) => void;
frame: (player: SpinePlayer, delta: number) => void;
update: (player: SpinePlayer, delta: number) => void;
draw: (player: SpinePlayer, delta: number) => void;
loading: (player: SpinePlayer, delta: number) => void;
downloader: Downloader;
}
This produce error when fill some properties or deep properties !


example code where i get types error !
ts
let jsonUrl = 'public/data2/Trees/tree2A/skeleton.json';
let atlasUrl = 'public/data2/Trees/tree2A/skeleton.atlas';

new SpinePlayer( 'player-container', {
jsonUrl: jsonUrl,
atlasUrl: atlasUrl,
animation: 'idle',
premultipliedAlpha: true,
backgroundColor: '#cccccc',
viewport: {
debugRender: true,
},
showControls: true,
} );
console.log( '🟩SpinePlayer:', SpinePlayer );
Those props should be not required no ?! how can i handle this ?
thanks


EDIT: github: https://github.com/EsotericSoftware/spine-runtimes/issues/2059
djmisterjon
  • Messaggi: 77


Torna a Bugs