MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / drawCount

Function drawCount

examples/drivers/m5dial-rotary_encoder/main.js:24–35  ·  view source on GitHub ↗
(count)

Source from the content-addressed store, hash-verified

22let font = parseBMF(new Resource("OpenSans-Regular-72.bf4"));
23
24function drawCount(count) {
25 render.begin();
26 render.fillRectangle(black, 0, 0, render.width, render.height);
27 render.drawText(
28 count,
29 font,
30 white,
31 (render.width - render.getTextWidth(count, font)) >> 1,
32 (render.height - font.height) >> 1
33 );
34 render.end();
35}
36
37let current = 0;
38drawCount(current);

Callers 3

main.jsFile · 0.85
onPushFunction · 0.85
onReadableFunction · 0.85

Calls 5

drawTextMethod · 0.80
getTextWidthMethod · 0.80
beginMethod · 0.65
fillRectangleMethod · 0.65
endMethod · 0.65

Tested by

no test coverage detected