ImageConfig
type ImageConfig = {
    src: string | StaticImageData;
    wearables: Image[];
    isWearable?: boolean;
    name?: string;
    /**
     * If set to false, the image won't be initialized unless you call `init` method
     */
    autoInit: boolean;
} & CommonDisplayable;The configuration of the image.
For CommonDisplayable, see CommonDisplayable.
Public Properties
src
The source of the image. It can be a URL or a StaticImageData.
wearables
The wearables of the image. Wearables are the images that can be worn by the character.
Same as image.addWearable
// method 1
const child = new Image({
    isWearable: true,
    /* ... */
});
const parent = new Image({
    src: "parent/image/src",
    wearables: [child]
});
 
// method 2
const child = new Image(/* ... */);
const parent = new Image(/* ... */).addWearable(child);
 
// method 3
const parent = new Image(/* ... */);
const child = new Image(/* ... */).bindWearable(parent);isWearable
Whether the image is a wearable or not. Default is false.
If you use parent.addWearable(child) or child.bindWearable(parent)
, it will automatically set isWearable to true.
Note: You cannot use a wearable without setting
isWearabletotrueor a parent image.
autoInit
If set to false, the image won't be initialized unless you call init method.