mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-18 05:49:49 +02:00
Fix
This commit is contained in:
@@ -134,16 +134,18 @@ module.exports = class WhosThatPokemonCommand extends Command {
|
|||||||
const silhouetteCtx = silhouetteCanvas.getContext('2d');
|
const silhouetteCtx = silhouetteCanvas.getContext('2d');
|
||||||
silhouetteCtx.drawImage(pkmn, 0, 0);
|
silhouetteCtx.drawImage(pkmn, 0, 0);
|
||||||
silhouette(silhouetteCtx, 0, 0, pkmn.width, pkmn.height);
|
silhouette(silhouetteCtx, 0, 0, pkmn.width, pkmn.height);
|
||||||
|
const ratio = pkmn.width / 200;
|
||||||
|
const height = pkmn.height * ratio;
|
||||||
if (hide) {
|
if (hide) {
|
||||||
ctx.globalAlpha = 0.5;
|
ctx.globalAlpha = 0.5;
|
||||||
ctx.drawImage(silhouetteCanvas, 25, 44, 200, 200);
|
ctx.drawImage(silhouetteCanvas, 25, 44, 200, height);
|
||||||
ctx.globalAlpha = 1;
|
ctx.globalAlpha = 1;
|
||||||
ctx.drawImage(silhouetteCanvas, 30, 39, 200, 200);
|
ctx.drawImage(silhouetteCanvas, 30, 39, 200, height);
|
||||||
} else {
|
} else {
|
||||||
ctx.globalAlpha = 0.5;
|
ctx.globalAlpha = 0.5;
|
||||||
ctx.drawImage(silhouetteCanvas, 25, 44, 200, 200);
|
ctx.drawImage(silhouetteCanvas, 25, 44, 200, height);
|
||||||
ctx.globalAlpha = 1;
|
ctx.globalAlpha = 1;
|
||||||
ctx.drawImage(pkmn, 30, 39, 200, 200);
|
ctx.drawImage(pkmn, 30, 39, 200, height);
|
||||||
ctx.font = this.client.fonts.get('Pokemon Solid.ttf').toCanvasString(60);
|
ctx.font = this.client.fonts.get('Pokemon Solid.ttf').toCanvasString(60);
|
||||||
ctx.textAlign = 'center';
|
ctx.textAlign = 'center';
|
||||||
ctx.textBaseline = 'bottom';
|
ctx.textBaseline = 'bottom';
|
||||||
|
|||||||
Reference in New Issue
Block a user