Parameterize info icon Y pos
This commit is contained in:
parent
7e86059465
commit
374bbe5bba
1 changed files with 13 additions and 13 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue