Draw a debug rectangle in world space * @param {Vector2} pos * @param {Vector2} [size=vec2(0)] * @param {Color|string} [color] * @param {number} [time] * @param {number} [angle] * @param {boolean} [fill] * @param {boolean} [screenSpace] * @memberof Debug
(pos, size=vec2(), color=WHITE, time=0, angle=0, fill=false, screenSpace=false)
| 76 | * @param {boolean} [screenSpace] |
| 77 | * @memberof Debug */ |
| 78 | function debugRect(pos, size=vec2(), color=WHITE, time=0, angle=0, fill=false, screenSpace=false) |
| 79 | { |
| 80 | ASSERT(isVector2(pos), 'pos must be a vec2'); |
| 81 | ASSERT(isVector2(size), 'size must be a vec2'); |
| 82 | ASSERT(isStringLike(color) || isColor(color), 'color is invalid'); |
| 83 | ASSERT(isNumber(time), 'time must be a number'); |
| 84 | ASSERT(isNumber(angle), 'angle must be a number'); |
| 85 | |
| 86 | if (isColor(color)) |
| 87 | color = color.toString(); |
| 88 | const timer = new Timer(time); |
| 89 | debugPrimitives.push({pos:pos.copy(), size:size.copy(), color, timer, angle, fill, screenSpace}); |
| 90 | } |
| 91 | |
| 92 | /** Draw a debug poly in world space |
| 93 | * @param {Vector2} pos |
no test coverage detected