Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TileLayer

Each tile in the wayward world is rendered as 4 subtiles (topleft, topright, bottomleft, bottomright). The world consists of 3 tile layers (terrain, doodad, doodadOver). Each subtile is a RGBA 32bit pixel representing a foreground and background tile. Red,Green make up the x,y coordinate in the tilesheet of the foreground tile. Blue,Alpha make up the x,y coordinate in the tilesheet of the background tile. If Red and Green are both 0, the subtile foreground is not rendered. If Blue and Alpha are both 0, the subtile background is not rendered.

Hierarchy

  • TileLayer

Index

Constructors

constructor

  • new TileLayer(type: TileLayerType, width: number, height: number, gl: WebGL2RenderingContext, positionBuffer: WebGLBuffer, isFixedDepth?: boolean, yRenderOffset?: number, tileAnimationFrames?: number, syncDoodadAnimationFrames?: number): TileLayer
  • Parameters

    • type: TileLayerType
    • width: number
    • height: number
    • gl: WebGL2RenderingContext
    • positionBuffer: WebGLBuffer
    • Default value isFixedDepth: boolean = false
    • Default value yRenderOffset: number = 0
    • Default value tileAnimationFrames: number = 2
    • Default value syncDoodadAnimationFrames: number = -1

    Returns TileLayer

Properties

Readonly isFixedDepth

isFixedDepth: boolean

Readonly renderLayerFlag

renderLayerFlag: RenderLayerFlag

Readonly type

Methods

getTileTLBG

  • getTileTLBG(dataIndex: number): []
  • Parameters

    • dataIndex: number

    Returns []

getTileTLFG

  • getTileTLFG(dataIndex: number): []
  • Parameters

    • dataIndex: number

    Returns []

render

  • render(gl: WebGL2RenderingContext, x: number, y: number, subTileSize: number, tileScale: number, viewWidth: number, viewHeight: number): void
  • Parameters

    • gl: WebGL2RenderingContext
    • x: number
    • y: number
    • subTileSize: number
    • tileScale: number
    • viewWidth: number
    • viewHeight: number

    Returns void

sendTileToGPU

  • sendTileToGPU(x: number, y: number, gl: WebGL2RenderingContext): void
  • Parameters

    • x: number
    • y: number
    • gl: WebGL2RenderingContext

    Returns void

sendToGPU

  • sendToGPU(gl: WebGL2RenderingContext): void
  • Parameters

    • gl: WebGL2RenderingContext

    Returns void

setTileBLBG

  • setTileBLBG(dataIndex: number, tileX: number, tileY: number): void
  • Parameters

    • dataIndex: number
    • tileX: number
    • tileY: number

    Returns void

setTileBLFG

  • setTileBLFG(dataIndex: number, tileX: number, tileY: number): void
  • Parameters

    • dataIndex: number
    • tileX: number
    • tileY: number

    Returns void

setTileBRBG

  • setTileBRBG(dataIndex: number, tileX: number, tileY: number): void
  • Parameters

    • dataIndex: number
    • tileX: number
    • tileY: number

    Returns void

setTileBRFG

  • setTileBRFG(dataIndex: number, tileX: number, tileY: number): void
  • Parameters

    • dataIndex: number
    • tileX: number
    • tileY: number

    Returns void

setTileTLBG

  • setTileTLBG(dataIndex: number, tileX: number, tileY: number): void
  • Parameters

    • dataIndex: number
    • tileX: number
    • tileY: number

    Returns void

setTileTLFG

  • setTileTLFG(dataIndex: number, tileX: number, tileY: number): void
  • Parameters

    • dataIndex: number
    • tileX: number
    • tileY: number

    Returns void

setTileTRBG

  • setTileTRBG(dataIndex: number, tileX: number, tileY: number): void
  • Parameters

    • dataIndex: number
    • tileX: number
    • tileY: number

    Returns void

setTileTRFG

  • setTileTRFG(dataIndex: number, tileX: number, tileY: number): void
  • Parameters

    • dataIndex: number
    • tileX: number
    • tileY: number

    Returns void

Static createShaders

  • createShaders(gl: WebGL2RenderingContext): void
  • Parameters

    • gl: WebGL2RenderingContext

    Returns void

Static linkShaders

  • Returns Promise<void>

Static setTileTexture

  • setTileTexture(texture: WebGLTexture, textureSizeInversed: Vector2): any
  • Parameters

    • texture: WebGLTexture
    • textureSizeInversed: Vector2

    Returns any

Generated using TypeDoc