Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

  • new Image2D(sourceName?: string, pixelsToWorldUnits?: number, disableSmoothing?: boolean, imagePixelSize?: Vector2, hasAlpha?: boolean, status?: ImageStatus): Image2D
  • Parameters

    • Optional sourceName: string
    • Optional pixelsToWorldUnits: number
    • Optional disableSmoothing: boolean
    • Optional imagePixelSize: Vector2
    • Optional hasAlpha: boolean
    • Optional status: ImageStatus

    Returns Image2D

Properties

disableSmoothing

disableSmoothing: boolean

Disable image bilinear filtering. This is useful for pixel art assets. Defaults to false.

hasAlpha

hasAlpha: boolean

Image contains any alpha values != 1 Set only after loading (status must be ImageStatus::Loaded)

imagePixelSize

imagePixelSize: Vector2

Image size in pixels Set only after loading (status must be ImageStatus::Loaded)

pixelsToWorldUnits

pixelsToWorldUnits: number

Conversion ratio of image pixels to world units, e.g.: The default value is 1. This should not be used for scaling sprites. The intended use for this value is loading lower resultion images as stand-ins or replacements of high resolution assets on lower quality settings or for progressive loading. 1 : 100 pixels = 100 world units 1/4: 100 pixels = 25 world units

sourceName

sourceName: string

the source of the image for debugging purposes To actually load an image attach any of the Image2DLoadFrom* components.

status

status: ImageStatus

Load status of the image

Static _isSharedComp

_isSharedComp: boolean

Static _size

_size: number

Static _view

_view: any

Static cid

cid: number

Static disableSmoothing

disableSmoothing: ComponentFieldDesc

Static hasAlpha

Static imagePixelSize

Static pixelsToWorldUnits

pixelsToWorldUnits: ComponentFieldDesc

Methods

Static _dtorFn

  • Parameters

    Returns void

Static _fromPtr

  • Parameters

    Returns Image2D

Static _tempHeapPtr

  • Parameters

    Returns number

Static _toPtr

  • _toPtr(p: number, v: Image2D): void
  • Parameters

    Returns void

Generated using TypeDoc