Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WorldRenderer

Hierarchy

  • WorldRenderer

Index

Constructors

constructor

  • Parameters

    • gl: WebGLRenderingContext
    • world: World

    Returns WorldRenderer

Properties

Private ambientColorCave

ambientColorCave: number[] = [0.5, 0.5, 0.5]

Private ambientColorDawn

ambientColorDawn: number[] = [0.92, 0.59, 0.55]

Private ambientColorDay

ambientColorDay: number[] = [1.0, 1.0, 1.0]

Private ambientColorNight

ambientColorNight: number[] = [0.4, 0.4, 1.0]

Private ambientIntensity

ambientIntensity: number = 1

Private compositeFramebuffer

compositeFramebuffer: WebGLFramebuffer

Private compositeTexture

compositeTexture: WebGLTexture

Private corpseBatch

corpseBatch: SpriteBatch

Private creatureBatch

creatureBatch: SpriteBatch

Private creaturesInViewport

creaturesInViewport: Array<number> = new Array<number>()

defaultAdaptor

defaultAdaptor: Default

Private depthBuffer

depthBuffer: WebGLFramebuffer

dirtAdaptor

dirtAdaptor: Dirt

fenceAdaptor

fenceAdaptor: Fence

floorAdaptor

floorAdaptor: Floor

Private fogFramebuffer

fogFramebuffer: WebGLFramebuffer

Private fogTexture

fogTexture: WebGLTexture

Private fogTextureStorage

fogTextureStorage: WebGLTexture

Private gl

gl: WebGLRenderingContext

Private itemBatch

itemBatch: SpriteBatch

Private layerFramebuffer

layerFramebuffer: WebGLFramebuffer

Private layerTexture

layerTexture: WebGLTexture

layers

mountainAdaptor

mountainAdaptor: Mountain

Private screenspaceViewport

screenspaceViewport: Vec2

Private tileScale

tileScale: number

Private viewportSpritesDirty

viewportSpritesDirty: boolean = true

wallAdaptor

wallAdaptor: Wall

waterAdaptor

waterAdaptor: Water

Private world

world: World

Private worldspaceViewport

worldspaceViewport: Vec2

Private zoom

zoom: number

Static ditherTexture

ditherTexture: WebGLTexture

Static emptyUint8Array

emptyUint8Array: Uint8Array | undefined = isEdge ? new Uint8Array(0) : undefined

Static Private fogShaderProgram

fogShaderProgram: CompiledProgram

Static positionBuffer

positionBuffer: WebGLBuffer

Static positionTextureBuffer

positionTextureBuffer: WebGLBuffer

Static Private subTileSize

subTileSize: number = 8

Static Private textureShaderProgram

textureShaderProgram: CompiledProgram

Static Private worldShaderProgram

worldShaderProgram: CompiledProgram

Methods

batchCreatures

  • batchCreatures(game: Game): void
  • Parameters

    Returns void

Private batchPlayer

  • Parameters

    Returns void

Private batchShadow

  • batchShadow(fromX: number, fromY: number, toX: number, toY: number, t: number, anim: number): void
  • Parameters

    • fromX: number
    • fromY: number
    • toX: number
    • toY: number
    • t: number
    • anim: number

    Returns void

computeSpritesInViewport

  • computeSpritesInViewport(): void
  • Returns void

Private computeSpritesInViewportInternal

  • computeSpritesInViewportInternal(game: Game): void
  • Parameters

    Returns void

getAmbientColor

  • getAmbientColor(): number[]
  • Returns number[]

getPixelSize

  • getPixelSize(): number
  • Returns number

getTileScale

  • getTileScale(): number
  • Returns number

getTileViewport

  • getTileViewport(): Vec2
  • Returns Vec2

getViewport

  • getViewport(): Vec2
  • Returns Vec2

getViewportBounds

  • getViewportBounds(): object
  • Returns object

    • max: vec2
    • min: vec2

getZoom

  • getZoom(): number
  • Returns number

render

  • render(): void
  • Returns void

renderWorld

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

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

    Returns void

screenToTile

  • screenToTile(screenX: number, screenY: number): vec2
  • Parameters

    • screenX: number
    • screenY: number

    Returns vec2

setSpriteTexture

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

    • texture: WebGLTexture
    • textureSizeInversed: Vec2

    Returns any

setTileScale

  • setTileScale(tileScale: number): void
  • Parameters

    • tileScale: number

    Returns void

setViewport

  • setViewport(view: Vec2): void
  • Parameters

    • view: Vec2

    Returns void

setZoom

  • setZoom(zoom: number): void
  • Parameters

    • zoom: number

    Returns void

Private spriteBatchForLayer

updateAll

  • updateAll(): void
  • Returns void

Static compileShaders

  • compileShaders(gl: WebGLRenderingContext): void
  • Parameters

    • gl: WebGLRenderingContext

    Returns void

Static getSubTileSize

  • getSubTileSize(): number
  • Returns number

Generated using TypeDoc