MCPcopy Index your code
hub / github.com/KilledByAPixel/LittleJS / renderIcon

Method renderIcon

plugins/medalSystem.js:215–222  ·  view source on GitHub ↗

Render the icon for a medal * @param {Vector2} pos - Screen space position * @param {number} size - Screen space size

(pos, size)

Source from the content-addressed store, hash-verified

213 * @param {number} size - Screen space size
214 */
215 renderIcon(pos, size)
216 {
217 // draw the image or icon
218 if (this.image)
219 mainContext.drawImage(this.image, pos.x-size/2, pos.y-size/2, size, size);
220 else
221 drawTextScreen(this.icon, pos, size*.7, BLACK);
222 }
223
224 // Get local storage key used by the medal
225 storageKey() { return medalsSaveName + '_' + this.id; }

Callers 2

renderMethod · 0.95
gameRenderPostFunction · 0.80

Calls 1

drawTextScreenFunction · 0.85

Tested by

no test coverage detected