Options
All
  • Public
  • Public/Protected
  • All
Menu

A component that keeps a read only alpha mask of an Image2D for use in HitBox2D hit testing, when pixelAccurate hit testing is enabled. Add the Image2DAlphaMask component next to an Image2D component before loading the image.

Hierarchy

Index

Constructors

constructor

  • new Image2DAlphaMask(threshold?: number, pixelData?: number[]): Image2DAlphaMask
  • Parameters

    • Optional threshold: number
    • Optional pixelData: number[]

    Returns Image2DAlphaMask

Properties

pixelData

pixelData: number[]

Array with alpha channel byte values, normalized to 0..1, same size as image.

threshold

threshold: number

Threshold value for when a bit is set or not, depending on the alpha value of the adjacent Image2D. Default value is .5.

Static _isSharedComp

_isSharedComp: boolean

Static _size

_size: number

Static _view

_view: any

Static cid

cid: number

Static threshold

Methods

Static _dtorFn

Static _fromPtr

Static _tempHeapPtr

Static _toPtr

  • Parameters

    Returns void

Generated using TypeDoc