Component for using tiles in a sprite map.
public this .sprite(Number x, Number y, Number w, Number h)
Uses a new location on the sprite map as its sprite.
Values should be in tiles or cells (not pixels).
Crafty.e("2D, DOM, Sprite")
.sprite(0, 0, 2, 2);
public this .crop(Number x, Number y, Number w, Number h)
If the entity needs to be smaller than the tile size, use this method to crop it.
The values should be in pixels rather than tiles.
Crafty.e("2D, DOM, Sprite")
.crop(40, 40, 22, 23);