Constructor Summary
Public Constructor | ||
public |
constructor(options: Object, element: HTMLElement) |
Member Summary
Public Members | ||
public |
|
|
public |
|
Private Members | ||
private |
_animId: * |
|
private |
_capeImage: * |
|
private |
_skinImage: * |
Method Summary
Public Methods | ||
public |
getModelByName(name: *): * |
|
public |
getPlayerModel(): * |
|
public |
Does the actual rendering |
|
public |
reset() |
|
public |
resize(width: *, height: *): * |
|
public |
toggleSkinPart(name: *, visible: *) |
Inherited Summary
From class Render | ||
public |
element: HTMLElement DOM Element to attach the renderer to |
|
public |
options: { Combined options |
|
public |
|
|
public |
addToScene(toAdd: *) Adds an object to the scene & sets userData.renderType to this renderer's type |
|
public |
clearScene(onlySelfType: *, filterFn: *) Clears the scene |
|
public |
dispose() |
|
public |
Export the current scene content in the .gltf format (geometries + textures) |
|
public |
|
|
public |
Export the current scene content in the .obj format (only geometries, no textures) |
|
public |
toPLY(exportOptions: *): * |
|
protected |
Initializes the scene |
Public Constructors
public constructor(options: Object, element: HTMLElement) source
Override:
Render#constructorParams:
Name | Type | Attribute | Description |
options | Object |
|
The options for this renderer, see defaultOptions |
element | HTMLElement |
|
DOM Element to attach the renderer to - defaults to document.body |
Public Members
Private Members
private _animId: * source
private _capeImage: * source
private _skinImage: * source
Public Methods
public render(texture: string | Object, cb: function) source
Does the actual rendering
Params:
Name | Type | Attribute | Description |
texture | string | Object | The texture to render - May be a string with the playername/URL/Base64 or an Object |
|
texture.url | string | URL to the texture image |
|
texture.data | string | Base64 encoded image data of the texture |
|
texture.username | string | Player username |
|
texture.uuid | string | Player UUID |
|
texture.mineskin | number | ID of a MineSkin.org skin |
|
texture.slim | boolean |
|
Whether the provided texture uses the slim skin format |
texture.cape | string |
|
Cape to render using capes.dev - Either a direct link to the cape data (api.capes.dev/get/...) OR a specific cape type |
texture.capeUser | string |
|
Specify this to use a different user for the cape texture than the skin |
texture.capeUrl | string |
|
URL to a cape texture |
texture.capeData | string |
|
Base64 encoded image data of the cape texture |
texture.mineskin | string |
|
deprecated; ID of a MineSkin.org skin with a cape |
texture.optifine | boolean |
|
deprecated; Whether the provided cape texture is an optifine cape |
cb | function |
|
Callback when rendering finished |
public reset() source
public resize(width: *, height: *): * source
Params:
Name | Type | Attribute | Description |
width | * | ||
height | * |
Return:
* |
public toggleSkinPart(name: *, visible: *) source
Params:
Name | Type | Attribute | Description |
name | * | ||
visible | * |