diff --git a/create-card.js b/create-card.js index ec3203d..4c50142 100644 --- a/create-card.js +++ b/create-card.js @@ -18,16 +18,6 @@ const jobsRowTextStartX = 495; const jobsRowTextSize = 30; const jobsRowTextSpacer = jobsRowTextSize * 2; -const deityIconCol = 252; -const deityIconRow = 805; - -const gcRankIconCol = 293; -const gcRankIconRow = 799; - -const fcCrestScale = 38; -const fcCrestCol = 345; -const fcCrestRow = 800; - const rectHeightRow1 = 120; // Title, Name, World const rectHeightRow2 = 40; // Mounts, Minions const rectHeightRow3 = 210; // Info @@ -63,6 +53,16 @@ console.log("rectStartRow2: " + rectStartRow2Y); console.log("rectStartRow3: " + rectStartRow3Y); console.log("rectStartRow4: " + rectStartRow4Y); +const deityIconY = rectStartRow3Y + 69; +const deityIconX = 805; + +const gcRankIconY = rectStartRow3Y + 110; +const gcRankIconX = 799; + +const fcCrestScale = 38; +const fcCrestY = rectStartRow3Y + 162; +const fcCrestX = 800; + class CardCreator { constructor() { this.isInit = false; @@ -234,17 +234,17 @@ class CardCreator { ctx.fillText(data.Character.GuardianDeity.Name, 480, 280); var deityIcon = await loadImage('https://xivapi.com/' + data.Character.GuardianDeity.Icon); - ctx.drawImage(deityIcon, deityIconRow, deityIconCol, 28, 28); + ctx.drawImage(deityIcon, deityIconX, deityIconY, 28, 28); if (data.Character.GrandCompany.Company != null) { ctx.fillText(data.Character.GrandCompany.Company.Name, 480, 330); var gcRankIcon = await loadImage('https://xivapi.com/' + data.Character.GrandCompany.Rank.Icon); - ctx.drawImage(gcRankIcon, gcRankIconRow, gcRankIconCol, 40, 40); + ctx.drawImage(gcRankIcon, gcRankIconX, gcRankIconY, 40, 40); } if (data.Character.FreeCompanyName != null) { var crestImage = await this.createCrest(data.FreeCompany.Crest); - ctx.drawImage(crestImage, fcCrestRow, fcCrestCol, fcCrestScale, fcCrestScale); + ctx.drawImage(crestImage, fcCrestX, fcCrestY, fcCrestScale, fcCrestScale); ctx.fillText(data.Character.FreeCompanyName, 480, 380); }