Packagenet.flashpunk.masks
Classpublic class Hitbox
InheritanceHitbox Inheritance Mask Inheritance Object
Subclasses Grid, Masklist, Pixelmask

Uses parent's hitbox to determine collision. This class is used internally by FlashPunk, you don't need to use this class because this is the default behaviour of Entities without a Mask object.



Public Properties
 PropertyDefined By
  height : int
Height.
Hitbox
 Inheritedlist : Masklist
The parent Masklist of the mask.
Mask
 Inheritedparent : Entity
The parent Entity of this mask.
Mask
  width : int
Width.
Hitbox
  x : int
X offset.
Hitbox
  y : int
Y offset.
Hitbox
Public Methods
 MethodDefined By
  
Hitbox(width:uint = 1, height:uint = 1, x:int = 0, y:int = 0)
Constructor.
Hitbox
 Inherited
collide(mask:Mask):Boolean
Checks for collision with another Mask.
Mask
 Inherited
renderDebug(g:Graphics):void
Used to render debug information in console.
Mask
  
update():void
[override]
Hitbox
Property Detail
heightproperty
height:int

Height.


Implementation
    public function get height():int
    public function set height(value:int):void
widthproperty 
width:int

Width.


Implementation
    public function get width():int
    public function set width(value:int):void
xproperty 
x:int

X offset.


Implementation
    public function get x():int
    public function set x(value:int):void
yproperty 
y:int

Y offset.


Implementation
    public function get y():int
    public function set y(value:int):void
Constructor Detail
Hitbox()Constructor
public function Hitbox(width:uint = 1, height:uint = 1, x:int = 0, y:int = 0)

Constructor.

Parameters
width:uint (default = 1) — Width of the hitbox.
 
height:uint (default = 1) — Height of the hitbox.
 
x:int (default = 0) — X offset of the hitbox.
 
y:int (default = 0) — Y offset of the hitbox.
Method Detail
update()method
override public function update():void