Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WorldRenderer

Hierarchy

Implements

Index

Constructors

constructor

  • Parameters

    • gl: WebGL2RenderingContext

    Returns WorldRenderer

Properties

defaultAdaptor

defaultAdaptor: ITileAdaptor

ditherTexture

ditherTexture: WebGLTexture

Readonly event

event: IEventEmitter<this, IWorldRendererEvents> = new EventEmitter<this, E>(this)

fenceAdaptor

fenceAdaptor: Fence

floorAdaptor

floorAdaptor: ITileAdaptor

lavaAdaptor

lavaAdaptor: ITileAdaptor

layers

layers: Record<number, WorldLayerRenderer>

mountainAdaptor

mountainAdaptor: ITileAdaptor

mountainGroundAdaptor

mountainGroundAdaptor: ITileAdaptor

positionBuffer

positionBuffer: WebGLBuffer

positionTextureBuffer

positionTextureBuffer: WebGLBuffer

tillAdaptor

tillAdaptor: ITileAdaptor

wallAdaptor

wallAdaptor: Wall

waterAdaptor

waterAdaptor: ITileAdaptor

Methods

batchMovable

  • batchMovable(timeStamp: number): boolean
  • Parameters

    • timeStamp: number

    Returns boolean

calculateAmbientColor

  • calculateAmbientColor(): []

computeSpritesInViewport

  • computeSpritesInViewport(): void

dispose

  • dispose(): void

getAmbientColorCave

  • getAmbientColorCave(): [number, number, number]

getAmbientColorDawn

  • getAmbientColorDawn(): [number, number, number]

getAmbientColorDay

  • getAmbientColorDay(): [number, number, number]

getAmbientColorNight

  • getAmbientColorNight(): [number, number, number]

getAmbientIntensity

  • getAmbientIntensity(): number

getFogColor

  • getFogColor(): [number, number, number]

getPixelSize

  • getPixelSize(): number

getTileScale

  • getTileScale(): number

getTileViewport

getViewport

getViewportBounds

getZoom

  • getZoom(): number

initializeSpriteBatch

  • Parameters

    Returns void

render

  • render(): void

renderWorld

  • renderWorld(x: number, y: number, z: number): void
  • Parameters

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

    Returns void

renderWorldLayer

  • renderWorldLayer(worldLayer: WorldLayerRenderer, x: number, y: number, tileScale: number, viewWidth: number, viewHeight: number, renderFlags: RenderFlag, enableDepth: boolean): void
  • Parameters

    • worldLayer: WorldLayerRenderer
    • x: number
    • y: number
    • tileScale: number
    • viewWidth: number
    • viewHeight: number
    • renderFlags: RenderFlag
    • enableDepth: boolean

    Returns void

screenToTile

  • screenToTile(screenX: number, screenY: number): Vector2 | undefined

screenToVector

  • screenToVector(screenX: number, screenY: number): Vector2

setSpriteTexture

  • setSpriteTexture(texture: WebGLTexture, textureSizeInversed: Vector2): any

setTileScale

  • setTileScale(tileScale: number): void
  • Parameters

    • tileScale: number

    Returns void

setViewport

setZoom

  • setZoom(zoom: number): void
  • Parameters

    • zoom: number

    Returns void

updateAll

  • updateAll(): void

Static createShaders

  • createShaders(gl: WebGL2RenderingContext): void
  • Parameters

    • gl: WebGL2RenderingContext

    Returns void

Static linkShaders

  • Returns Promise<void>

Generated using TypeDoc