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(width: number, height: number, gl: WebGL2RenderingContext, positionBuffer: WebGLBuffer): TileLayer
  • Parameters

    • width: number
    • height: number
    • gl: WebGL2RenderingContext
    • positionBuffer: WebGLBuffer

    Returns TileLayer

Methods

clear

  • clear(): void
  • Returns void

render

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

    • gl: WebGL2RenderingContext
    • x: number
    • y: number
    • subTileSize: number
    • tileScale: number
    • viewWidth: number
    • viewHeight: number
    • Default value fixedDepth: boolean = false

    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 compileShaders

  • compileShaders(gl: WebGL2RenderingContext): void
  • Parameters

    • gl: WebGL2RenderingContext

    Returns void

Static setTileTexture

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

    • texture: WebGLTexture
    • textureSizeInversed: Vec2

    Returns any

Generated using TypeDoc