Fork me on GitHub
View source

package com.haxepunk.masks

class Pixelmask


extends Hitbox
extended by Imagemask

A bitmap mask used for pixel-perfect collision.

Constructor

View source

new (source : Dynamic, x : Int = 0, y : Int = 0) : Void

Constructor.


Parameters:
source   

The image to use as a mask.

x   

X offset of the mask.

y   

Y offset of the mask.

Variables

data : BitmapData

Current BitmapData mask.

threshold : Int

Alpha threshold of the bitmap used for collision.