Interface SkinViewerOptions

interface SkinViewerOptions {
    animation?: PlayerAnimation;
    background?: Texture | ColorRepresentation;
    canvas?: HTMLCanvasElement;
    cape?: RemoteImage | TextureSource;
    ears?: {
        source: RemoteImage | TextureSource;
        textureType: "skin" | "standalone";
    } | "current-skin";
    enableControls?: boolean;
    fov?: number;
    height?: number;
    model?: ModelType | "auto-detect";
    nameTag?: string | NameTagObject;
    panorama?: RemoteImage | TextureSource;
    pixelRatio?: number | "match-device";
    preserveDrawingBuffer?: boolean;
    renderPaused?: boolean;
    skin?: RemoteImage | TextureSource;
    width?: number;
    zoom?: number;
}

Properties

animation?: PlayerAnimation

The animation to play on the player.

Default Value

If unspecified, no animation will be played.
background?: Texture | ColorRepresentation

The background of the scene.

Default Value

transparent
canvas?: HTMLCanvasElement

The canvas where the renderer draws its output.

Default Value

If unspecified, a new canvas element will be created.
cape?: RemoteImage | TextureSource

The cape texture of the player.

Default Value

If unspecified, the cape will be invisible.
ears?: {
    source: RemoteImage | TextureSource;
    textureType: "skin" | "standalone";
} | "current-skin"

The ear texture of the player.

When set to "current-skin", the ears drawn on the current skin texture (as is specified in the skin option) will be shown.

To use an individual ear texture, you have to specify the textureType and the source option. source is the texture to use, and textureType can be either "standalone" or "skin":

  • "standalone" means the provided texture is a 14x7 image that only contains the ears.
  • "skin" means the provided texture is a skin texture with ears, and we will show its ear part.

Type declaration

  • source: RemoteImage | TextureSource
  • textureType: "skin" | "standalone"

Default Value

If unspecified, the ears will be invisible.
enableControls?: boolean

Whether to enable mouse control function.

This function is implemented using OrbitControls. By default, zooming and rotating are enabled, and panning is disabled.

Default Value

true

fov?: number

Camera vertical field of view, in degrees.

The distance between the player and the camera will be automatically computed from fov and zoom.

height?: number

The CSS height of the canvas.

model?: ModelType | "auto-detect"

The model of the player ("default" for normal arms, and "slim" for slim arms).

When set to "auto-detect", the model will be inferred from the skin texture.

If the skin option is not specified, this option will have no effect.

Default Value

"auto-detect"

nameTag?: string | NameTagObject

The name tag to display above the player.

Default Value

If unspecified, no name tag will be displayed.

See

SkinViewer.nameTag

panorama?: RemoteImage | TextureSource

The panorama background to use.

This option overrides the background option.

pixelRatio?: number | "match-device"

The pixel ratio of the canvas.

When set to "match-device", the current device pixel ratio will be used, and it will be automatically updated when the device pixel ratio changes.

Default Value

"match-device"

preserveDrawingBuffer?: boolean

Whether to preserve the buffers until manually cleared or overwritten.

Default Value

false

renderPaused?: boolean

Whether to pause the rendering and animation loop.

Default Value

false

skin?: RemoteImage | TextureSource

The skin texture of the player.

Default Value

If unspecified, the skin will be invisible.
width?: number

The CSS width of the canvas.

zoom?: number

Zoom ratio of the player.

This value affects the distance between the object and the camera. When set to 1.0, the top edge of the player's head coincides with the edge of the canvas.

The distance between the player and the camera will be automatically computed from fov and zoom.

Default Value

0.9

See

SkinViewer.adjustCameraDistance

Generated using TypeDoc