MCPcopy
hub / github.com/KilledByAPixel/LittleJS / debugCircle

Function debugCircle

src/engineDebug.js:125–137  ·  view source on GitHub ↗

Draw a debug circle in world space * @param {Vector2} pos * @param {number} [size] - diameter * @param {Color|string} [color] * @param {number} [time] * @param {boolean} [fill] * @param {boolean} [screenSpace] * @memberof Debug

(pos, size=0, color=WHITE, time=0, fill=false, screenSpace=false)

Source from the content-addressed store, hash-verified

123 * @param {boolean} [screenSpace]
124 * @memberof Debug */
125function debugCircle(pos, size=0, color=WHITE, time=0, fill=false, screenSpace=false)
126{
127 ASSERT(isVector2(pos), 'pos must be a vec2');
128 ASSERT(isNumber(size), 'size must be a number');
129 ASSERT(isStringLike(color) || isColor(color), 'color is invalid');
130 ASSERT(isNumber(time), 'time must be a number');
131
132 if (isColor(color))
133 color = color.toString();
134 pos = pos.copy();
135 const timer = new Timer(time);
136 debugPrimitives.push({pos, size, color, timer, angle:0, fill, screenSpace});
137}
138
139/** Draw a debug point in world space
140 * @param {Vector2} pos

Callers 7

gamepadsUpdateFunction · 0.70
debugRenderFunction · 0.70
updateMethod · 0.70
smoothPathCornersMethod · 0.50
findPathMethod · 0.50
gameUpdateFunction · 0.50
updateMethod · 0.50

Calls 7

isVector2Function · 0.85
isNumberFunction · 0.85
isStringLikeFunction · 0.85
isColorFunction · 0.85
ASSERTFunction · 0.70
toStringMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected