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

Function drawCircleGradient

src/engineDraw.js:829–833  ·  view source on GitHub ↗

Draw a circle filled with a radial gradient from the center to the rim * - Best when batched with other untextured polys * - If drawing mostly textured sprites, bake the gradient into a texture and use drawTile instead * - Stacking gradients at the exact same position may show a faint vertical

(pos, size=1, colorInner=WHITE, colorOuter=CLEAR_WHITE, useWebGL=glEnable, screenSpace=false, context)

Source from the content-addressed store, hash-verified

827 * @param {CanvasRenderingContext2D|OffscreenCanvasRenderingContext2D} [context]
828 * @memberof Draw */
829function drawCircleGradient(pos, size=1, colorInner=WHITE, colorOuter=CLEAR_WHITE, useWebGL=glEnable, screenSpace=false, context)
830{
831 ASSERT(isNumber(size), 'size must be a number');
832 drawEllipseGradient(pos, vec2(size), colorInner, colorOuter, 0, useWebGL, screenSpace, context);
833}
834
835/**
836 * @callback Canvas2DDrawFunction - A function that draws to a 2D canvas context

Callers 2

smoke.test.mjsFile · 0.85
gameRenderFunction · 0.85

Calls 4

isNumberFunction · 0.85
drawEllipseGradientFunction · 0.85
vec2Function · 0.85
ASSERTFunction · 0.70

Tested by

no test coverage detected