DebugRectangle 组件
用于将对象的位置和尺寸绘制到调试层上的组件。
var myEntity = Crafty.e("2D, DebugRectangle")
.attr({x: 13, y: 37, w: 42, h: 42})
.debugStroke("green");
myEntity.debugRectangle(myEntity)
方法
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.