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

Method render

examples/shorts/box2dPool.js:44–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42 this.destroy();
43 }
44 render()
45 {
46 super.render();
47
48 // draw white circle and ball number
49 drawCircle(this.pos, .6, WHITE);
50 const textPos = this.pos.add(vec2(0,-.06));
51 if (this.number)
52 drawText(this.number, textPos, .5, BLACK);
53 if (this.canHit())
54 {
55 // draw the aim line
56 const endPos = this.pos.add(this.getHitOffset());
57 const width = this.getHitStrength();
58 drawLine(this.pos, endPos, width, hsl(0,1,.5,.5),
59 vec2(), 0, false);
60 }
61 }
62}
63
64class Pocket extends Box2dStaticObject

Callers

nothing calls this directly

Calls 9

canHitMethod · 0.95
getHitOffsetMethod · 0.95
getHitStrengthMethod · 0.95
drawCircleFunction · 0.85
vec2Function · 0.85
drawLineFunction · 0.85
hslFunction · 0.85
drawTextFunction · 0.50
addMethod · 0.45

Tested by

no test coverage detected