Skip to content
This repository was archived by the owner on Jun 1, 2021. It is now read-only.

Commit b7b5e2a

Browse files
Added improved render settings
1 parent 9ccbc41 commit b7b5e2a

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/Client/Renderer/Renderer.js

+9-8
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ class Canvas {
2727
this.canvas = createCanvas(400, 400);
2828
this.context = this.canvas.getContext('2d');
2929

30+
this.context.patternQuality = 'good';
31+
this.context.quality = 'good';
32+
this.context.textDrawingMode = 'glyph';
33+
this.context.antialias = 'default';
34+
3035
// Load krunker coin icon.
3136
const krIconData = fs.readFileSync('./res/kr-icon.png');
3237
this.krIcon = new Image();
@@ -114,8 +119,7 @@ class Canvas {
114119
this.drawStatRow('Time Played:', this.formatTimePlayed(data.playTime), 6, statFontSizePx, 0, 10);
115120
}
116121

117-
drawFooter()
118-
{
122+
drawFooter() {
119123
this.context.font = '15px FFF Forward';
120124
this.context.fillStyle = '#b0b0b0';
121125

@@ -321,15 +325,13 @@ class Canvas {
321325
return str;
322326
}
323327

324-
drawLeaderboardTitle(board)
325-
{
328+
drawLeaderboardTitle(board) {
326329
this.context.font = `${board.length < 8 ? lbTitleFontSizePx : lbTitleFontSize2Px}px FFF Forward`;
327330
this.context.fillStyle = '#FFFFFF';
328331
this.context.fillText(board.name.charAt(0).toUpperCase() + board.name.slice(1) + ' Leaderboard', 2 * padLeft, titleBarHeight / 2 + (board.length < 15 ? lbTitleFontSizePx : lbTitleFontSize2Px) * 0.6);
329332
}
330333

331-
async drawLeaderboardList(board)
332-
{
334+
async drawLeaderboardList(board) {
333335
const yOffset = -20;
334336
//this.drawStatRow('', board.unit, 0, statFontSize2Px, 0, yOffset);
335337
this.context.font = `${statFontSize2Px}px FFF Forward`;
@@ -338,8 +340,7 @@ class Canvas {
338340
this.canvas.width - padRight - this.context.measureText(board.unit).width,
339341
titleBarHeight - 4);
340342

341-
for(let i = 0; i < 10; i++)
342-
{
343+
for(let i = 0; i < 10; i++) {
343344
if(board.name == 'Levels') {
344345
this.drawLevelLeaderboardRow(board.data[i].name, board.data[i].clan, board.data[i].featured, board.data[i].attribute, i, statFontSize2Px, 0, yOffset);
345346
}

0 commit comments

Comments
 (0)