Перейти к основному содержанию

Render

We're meant native renderer, it's not connected with same class here.

Index

Namespaces

Renderer

Renderer:

Transform

Transform: Render.Transform

Interfaces

Cache

Cache:
@deprecated

Unavailable feature, renderers must be saved independently.

isChangeable

isChangeable: boolean

model

model: Model

parts

parts: {}

Type declaration

renderId

renderId: number

renderer

renderer: Renderer

FinalizeCallback

FinalizeCallback:

onFinalized

  • Parameters

    Returns void

FinalizeCallbackJS

  • FinalizeCallbackJS(renderer: Renderer): void
  • Parameters

    Returns void

Model

Model:

clearAllParts

  • clearAllParts(): void
  • Clears all parts of the model.


    Returns void

getPart


  • Parameters

    • partName: string

      part name

    Returns ModelPart

    Part by it's name or null if part doesn't exist.

hasPart

  • hasPart(partName: string): boolean

  • Parameters

    • partName: string

      part name

    Returns boolean

    true if part with specified name exists in the model, false otherwise.

reset

  • reset(): void
  • Resets the model


    Returns void

ModelPart

ModelPart:

addBox

  • addBox(x: number, y: number, z: number, w: number, h: number, l: number): void
  • addBox(x: number, y: number, z: number, w: number, h: number, l: number, add: number): void
  • Adds a new box to the part on the specified coordinates (relative to the part's coordinates) of the specified size (width, height, length).


    Parameters

    • x: number
    • y: number
    • z: number
    • w: number
    • h: number
    • l: number

    Returns void

addPart

  • Creates a new part with specified name. If a part with specified name already exists, returns the existing part.


    Parameters

    • name: string

      name of the part to create or return

    Returns ModelPart

clear

  • clear(): void
  • Clears the contents of the part.


    Returns void

getMesh

setMesh

setOffset

  • setOffset(offsetX: number, offsetY: number, offsetZ: number): void
  • Specifies part default offset.


    Parameters

    • offsetX: number
    • offsetY: number
    • offsetZ: number

    Returns void

setRotation

  • setRotation(rotationX: number, rotationY: number, rotationZ: number): void
  • Specifies part rotation.


    Parameters

    • rotationX: number
    • rotationY: number
    • rotationZ: number

    Returns void

setTextureOffset

  • setTextureOffset(u: number, v: number): void
  • setTextureOffset(u: number, v: number): void
  • setTextureOffset(u: number, v: number, placeholder: boolean): void
  • Specifies texture UV offset.


    Parameters

    • u: number
    • v: number

    Returns void

setTextureSize

  • setTextureSize(w: number, h: number): void
  • setTextureSize(w: number, h: number): void
  • setTextureSize(w: number, h: number, placeholder: boolean): void
  • Specifies texture size size, use the real texture file size or change it to stretch texture.


    Parameters

    • w: number
    • h: number

    Returns void

PartElement

PartElement:

Part's box description specified in Render.setPart method.

optionalchildren

children?: PartElement[]

Specifies child elements, using current box coordinates as base for the child boxes.

coords

coords: Vector

Box coordinates, relative to part's coordinates.

size

size: { w?: number; x: number; y: number; z: number }

Box size.

@param

additional size to be added from all the six sizes of the box


Type declaration

  • optionalw?: number
  • x: number
  • y: number
  • z: number

optionaluv

uv?: { x: number; y: number }

Box texture offset.


Type declaration

  • x: number
  • y: number

PartParameters

PartParameters:

An interface of the object that is used as Render.addPart parameter.

optionaladd

add?: boolean

If false or not specified in Render.setPart call, the part is cleared, otherwise new parts and params are applied to the existing parts.

optionalheight

height?: number

Texture height, use the real texture file height or change it to stretch texture.

optionalpos

pos?: [number, number, number] | Vector

Part center position.

optionalrotation

rotation?: [number, number, number] | Vector

Part rotation.

optionalu

u?: number

Texture horizontal offset from left up corner.

optionalv

v?: number

Texture vertical offset from left up corner.

optionalwidth

width?: number

Texture width, use the real texture file width or change it to stretch texture.

RenderParameters

RenderParameters:

An interface of the object that is used as Render.constructor parameter.

optionalitem

item?: number

Item ID for Item Sprite render type.

optionalname

name?: string

Name of the cached Render object to be used.

@deprecated

Unavailable feature, renderers must be saved independently.

optionalraw

raw?: boolean

If set to true, a humanoid render is constructed, empty otherwise.

optionalscale

scale?: number

Render scale multiplier.

optionalskin

skin?: string

Relative path to the texture used by render, e.g. "textures/entity/zombie.png".

Renderer

Renderer:

isHumanoid

isHumanoid: boolean

transform

transform: Transform

addFinalizeCallback

getModel

getPointer

  • getPointer(): number
  • Returns number

getRenderType

  • getRenderType(): number
  • Returns number

getScale

  • getScale(): number
  • Returns number

release

  • release(): void
  • Returns void

setFinalizeable

  • setFinalizeable(finalizeable: boolean): void
  • Parameters

    • finalizeable: boolean

    Returns void

setScale

  • setScale(scale: number): void
  • Parameters

    • scale: number

    Returns void

setSkin

  • setSkin(skin: string): void
  • Parameters

    • skin: string

    Returns void

Transform

Transform:

Interface used to perform transformation on the specified render object.

clear

  • Clears all the transformations applied to the render.


    Returns Transform

    Reference to itself to be used in sequential calls.

lock


  • Returns Transform

    Reference to itself to be used in sequential calls.

matrix

  • matrix(m00: number, m01: number, m02: number, m03: number, m10: number, m11: number, m12: number, m13: number, m20: number, m21: number, m22: number, m23: number, m30: number, m31: number, m32: number, m33: number): Transform
  • Performs arbitrary matrix transformations on the render.


    Parameters

    • m00: number
    • m01: number
    • m02: number
    • m03: number
    • m10: number
    • m11: number
    • m12: number
    • m13: number
    • m20: number
    • m21: number
    • m22: number
    • m23: number
    • m30: number
    • m31: number
    • m32: number
    • m33: number

    Returns Transform

    Reference to itself to be used in sequential calls.

rotate

  • rotate(rotX: number, rotY: number, rotZ: number): Transform
  • Rotates render along three axes.


    Parameters

    • rotX: number
    • rotY: number
    • rotZ: number

    Returns Transform

    Reference to itself to be used in sequential calls.

scale

  • scale(scaleX: number, scaleY: number, scaleZ: number): Transform
  • Scales render along the three axes.


    Parameters

    • scaleX: number
    • scaleY: number
    • scaleZ: number

    Returns Transform

    Reference to itself to be used in sequential calls.

scaleLegacy

  • Scales the render along all the three axes. Applicable only to the Animation's transformations.

    @deprecated

    Consider using Render.Transform.scale instead.


    Parameters

    • scale: number

    Returns Transform

    Reference to itself to be used in sequential calls.

translate

  • translate(x: number, y: number, z: number): Transform
  • Translates render along three axes.


    Parameters

    • x: number
    • y: number
    • z: number

    Returns Transform

    Reference to itself to be used in sequential calls.

unlock


  • Returns Transform

    Reference to itself to be used in sequential calls.