Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

  • new TextureAtlas(textureKey: string, jsonKey: string, w: number, h: number, game: Game, scene: Scene): TextureAtlas

Properties

Readonly dataType

dataType: DataType
memberof

TextureBase

description

The data type of texture, 'sheet' | 'base' | 'atlas' | 'list'

since

2.1.0

game

game: Game

Readonly id

id: string
memberof

TextureBase

description

The unique identifier for the texture

since

2.1.0

json

scale

scale: Vector2
memberof

Texture

description

The scale of the texture

since

2.1.0

scene

scene: Scene

texture

texture: HTMLImageElement
memberof

TextureBase

description

The texture itself, can be an image or color

since

2.1.0

type

memberof

TextureBase

description

The type of texture source, 'image' | 'color' | 'either'

since

2.1.0

Methods

get

  • get(key: string): undefined | Texture<"image">

Protected parseJSON

  • parseJSON(): void

setFillColor

  • setFillColor(color: string | number): void

setImagePath

  • setImagePath(imagePath: string): void

setScale

Protected validateJSON

  • validateJSON(): void

Static fromColor

  • fromColor(color: string, w: number, h: number): TextureBase<"color">

Static fromEither

  • fromEither(fillColorOrIMGPath: string, w: number, h: number): TextureBase<"either">

Static fromTexture

  • fromTexture(imgpath: string, w: number, h: number): TextureBase<"image">

Generated using TypeDoc