DebugRectangle Component

A component for rendering an object with a position and dimensions to the debug canvas.

var myEntity = Crafty.e("2D, DebugRectangle")
                     .attr({x: 13, y: 37, w: 42, h: 42})
                     .debugStroke("green");
myEntity.debugRectangle(myEntity)

See Also

Methods

Back to top

.debugRectangle()

public .debugRectangle(Object rect)
rect

an object with _x, _y, _w, and _h to draw

Sets the rectangle that this component draws to the debug canvas.