This commit is contained in:
Kyle
2020-12-17 14:37:47 -08:00
parent ff061196da
commit 80907f14ba
7 changed files with 15 additions and 10 deletions

View File

@@ -38,6 +38,7 @@ var scryfallArt;
var scryfallCard;
//for text
var savedTextXPosition = 0;
var params = new URLSearchParams(window.location.search);
//for misc
var date = new Date();
//to avoid rerunning special scripts (planeswalker, saga, etc...)
@@ -68,7 +69,7 @@ async function resetCardIrregularities({canvas = [1500, 2100, 0, 0], resetOthers
midLeft: {text:'{elemidinfo-set}*{elemidinfo-language} {savex}{fontbelerenbsc}{fontsize' + scaleHeight(0.001) + '}{upinline' + scaleHeight(0.0005) + '}\uFFEE{elemidinfo-artist}', x:0.0647, y:0.9548, width:0.8707, height:0.0171, oneLine:true, font:'gothammedium', size:0.0171, color:'white', outlineWidth:0.003},
topLeft: {text:'{elemidinfo-number}{loadx}{elemidinfo-rarity}', x:0.0647, y:0.9377, width:0.8707, height:0.0171, oneLine:true, font:'gothammedium', size:0.0171, color:'white', outlineWidth:0.003},
bottomLeft: {text:'NOT FOR SALE', x:0.0647, y:0.9719, width:0.8707, height:0.0143, oneLine:true, font:'gothammedium', size:0.0143, color:'white', outlineWidth:0.003},
wizards: {text:'{ptshift0,0.0172}\u2122 & \u00a9 ' + date.getFullYear() + ' Wizards of the Coast', x:0.0647, y:0.9377, width:0.8707, height:0.0167, oneLine:true, font:'mplantin', size:0.0162, color:'white', align:'right', outlineWidth:0.003},
wizards: {name:'wizards', text:'{ptshift0,0.0172}\u2122 & \u00a9 ' + date.getFullYear() + ' Wizards of the Coast', x:0.0647, y:0.9377, width:0.8707, height:0.0167, oneLine:true, font:'mplantin', size:0.0162, color:'white', align:'right', outlineWidth:0.003},
bottomRight: {text:'{ptshift0,0.0172}CardConjurer.com', x:0.0647, y:0.9548, width:0.8707, height:0.0143, oneLine:true, font:'mplantin', size:0.0143, color:'white', align:'right', outlineWidth:0.003}
});
//onload
@@ -462,7 +463,11 @@ function writeText(textObject, targetContext) {
lineCanvas.height = startingTextSize + 2 * canvasMargin;
//Preps the text string
var splitString = '6GJt7eL8';
var splitText = textObject.text.replace(/\n/g, '{line}').replace('{flavor}', '{lns}{bar}{lns}{i}').replace(/{/g, splitString + '{').replace(/}/g, '}' + splitString).replace(/ /g, splitString + ' ' + splitString).split(splitString);
var rawText = textObject.text
if (params.get('copyright') != null && textObject.name == 'wizards' && card.version == 'margin') {
rawText = params.get('copyright'); //so people using CC for custom card games can customize their copyright info
}
var splitText = rawText.replace(/\n/g, '{line}').replace('{flavor}', '{lns}{bar}{lns}{i}').replace(/{/g, splitString + '{').replace(/}/g, '}' + splitString).replace(/ /g, splitString + ' ' + splitString).split(splitString);
splitText = splitText.filter(item => item);
splitText.push('');
//Manages the redraw loop

View File

@@ -40,9 +40,9 @@ document.querySelector('#loadFrameVersion').onclick = async function() {
//text
loadTextOptions({
mana: {name:'Mana Cost', text:'', y:0.0613, width:0.9292, height:71/2100, oneLine:true, size:71/1638, align:'right', shadowX:-0.001, shadowY:0.0029, manaCost:true, manaSpacing:0},
title: {name:'Title', text:'', x:0.0854, y:0.0522, width:0.8292, height:0.0543, oneLine:true, font:'belerenb', size:0.0381, color:'white', shadowX:0.0014, shadowY:0.001},
type: {name:'Type', text:'', x:0.0854, y:0.5664, width:0.8292, height:0.0543, oneLine:true, font:'belerenb', size:0.0324, color:'white', shadowX:0.0014, shadowY:0.001},
rules: {name:'Rules Text', text:'', x:0.086, y:0.6303, width:0.828, height:0.2875, size:0.0362, color:'white', shadowX:0.0014, shadowY:0.001},
title: {name:'Title', text:'', x:0.0854, y:0.0522, width:0.8292, height:0.0543, oneLine:true, font:'belerenb', size:0.0381, color:'white'},
type: {name:'Type', text:'', x:0.0854, y:0.5664, width:0.8292, height:0.0543, oneLine:true, font:'belerenb', size:0.0324, color:'white'},
rules: {name:'Rules Text', text:'', x:0.0927, y:0.6303, width:0.8147, height:0.2875, size:0.0362, color:'white'},
pt: {name:'Power/Toughness', text:'', x:0.7928, y:0.902, width:0.1367, height:0.0372, size:0.0372, font:'belerenbsc', oneLine:true, align:'center', color:'white'}
});
}

View File

@@ -54,7 +54,7 @@ document.querySelector('#loadFrameVersion').onclick = async function() {
//bottom info
loadBottomInfo({
top: {text:'{ptshift-0.1667,0}\uFFEE {elemidinfo-artist}', x:0.094, y:1898/2100, width:0.8107, height:0.0248, oneLine:true, font:'matrixb', size:0.0248, color:'white', align:'right', shadowX:0.0007, shadowY:0.0005},
wizards: {text:'{ptshift-0.1667,0}\u2122 & \u00a9 1993-' + date.getFullYear() + ' Wizards of the Coast, Inc. {elemidinfo-number}', x:0.094, y:1954/2100, width:0.8107, height:0.0153, oneLine:true, font:'mplantin', size:0.0153, color:'white', align:'right', shadowX:0.0007, shadowY:0.0005},
wizards: {name:'wizards', text:'{ptshift-0.1667,0}\u2122 & \u00a9 1993-' + date.getFullYear() + ' Wizards of the Coast, Inc. {elemidinfo-number}', x:0.094, y:1954/2100, width:0.8107, height:0.0153, oneLine:true, font:'mplantin', size:0.0153, color:'white', align:'right', shadowX:0.0007, shadowY:0.0005},
bottom: {text:'{ptshift-0.1667,0}NOT FOR SALE CardConjurer.com', x:0.094, y:1990/2100, width:0.8107, height:0.0134, oneLine:true, font:'mplantin', size:0.0134, color:'white', align:'right', shadowX:0.0007, shadowY:0.0005}
});
}

View File

@@ -30,7 +30,7 @@ document.querySelector('#loadFrameVersion').onclick = async function() {
//bottom info
loadBottomInfo({
top: {text:'Illus: {elemidinfo-artist}', x:0.0614, y:0.8972, width:0.8774, height:0.0281, oneLine:true, size:0.0281, align:'center', shadowX:0.0027, shadowY:0.002, color:'white'},
wizards: {text:'\u2122 & \u00a9 ' + date.getFullYear() + ' Wizards of the Coast', x:0.0614, y:0.9267, width:0.8774, height:0.0172, oneLine:true, size:0.0172, align:'center', shadowX:0.0027, shadowY:0.002, color:'white'},
wizards: {name:'wizards', text:'\u2122 & \u00a9 ' + date.getFullYear() + ' Wizards of the Coast', x:0.0614, y:0.9267, width:0.8774, height:0.0172, oneLine:true, size:0.0172, align:'center', shadowX:0.0027, shadowY:0.002, color:'white'},
bottom: {text:'NOT FOR SALE CardConjurer.com', x:0.0614, y:0.9458, width:0.8774, height:0.0143, oneLine:true, size:0.0143, align:'center', shadowX:0.0027, shadowY:0.002, color:'white'}
});
}

View File

@@ -33,7 +33,7 @@ document.querySelector('#loadFrameVersion').onclick = async function() {
//bottom info
await loadBottomInfo({
top: {text:'\uFFEE{elemidinfo-artist}', x:0.0647, y:0.9434, width:0.8707, height:0.0174, oneLine:true, font:'belerenbsc', size:0.0174, color:'white', outlineWidth:0.003, align:'center'},
wizards: {text:'{elemidinfo-number} {elemidinfo-set} * {elemidinfo-language} {fontmplantin}\u2122 & \u00a9 ' + date.getFullYear() + ' Wizards of the Coast', x:0.0647, y:0.9614, width:0.8707, height:0.0167, oneLine:true, font:'gothammedium', size:0.0162, color:'white', align:'center', outlineWidth:0.003},
wizards: {name:'wizards', text:'{elemidinfo-number} {elemidinfo-set} * {elemidinfo-language} {fontmplantin}\u2122 & \u00a9 ' + date.getFullYear() + ' Wizards of the Coast', x:0.0647, y:0.9614, width:0.8707, height:0.0167, oneLine:true, font:'gothammedium', size:0.0162, color:'white', align:'center', outlineWidth:0.003},
bottom: {text:'NOT FOR SALE {fontmplantin}CardConjurer.com', x:0.0647, y:0.98, width:0.8707, height:0.0143, oneLine:true, font:'gothammedium', size:0.0143, color:'white', align:'center', outlineWidth:0.003}
});
//runs other necessary functions

View File

@@ -46,7 +46,7 @@ document.querySelector('#loadFrameVersion').onclick = async function() {
//bottom info
loadBottomInfo({
top: {text:'Illus: {elemidinfo-artist}', x:0.0614, y:0.8915, width:0.8774, height:0.0281, oneLine:true, size:0.0281, align:'center', shadowX:0.0027, shadowY:0.002, color:'white'},
wizards: {text:'\u2122 & \u00a9 ' + date.getFullYear() + ' Wizards of the Coast', x:0.0614, y:0.921, width:0.8774, height:0.0172, oneLine:true, size:0.0172, align:'center', shadowX:0.0027, shadowY:0.002, color:'white'},
wizards: {name:'wizards', text:'\u2122 & \u00a9 ' + date.getFullYear() + ' Wizards of the Coast', x:0.0614, y:0.921, width:0.8774, height:0.0172, oneLine:true, size:0.0172, align:'center', shadowX:0.0027, shadowY:0.002, color:'white'},
bottom: {text:'NOT FOR SALE CardConjurer.com', x:0.0614, y:0.94, width:0.8774, height:0.0143, oneLine:true, size:0.0143, align:'center', shadowX:0.0027, shadowY:0.002, color:'white'}
});
}

View File

@@ -37,7 +37,7 @@ document.querySelector('#loadFrameVersion').onclick = async function() {
//bottom info
loadBottomInfo({
top: {text:'Illus: {elemidinfo-artist}', x:0.0614, y:0.8915, width:0.8774, height:0.0281, oneLine:true, size:0.0281, align:'center', shadowX:0.0027, shadowY:0.002, color:'white'},
wizards: {text:'\u2122 & \u00a9 ' + date.getFullYear() + ' Wizards of the Coast', x:0.0614, y:0.921, width:0.8774, height:0.0172, oneLine:true, size:0.0172, align:'center', shadowX:0.0027, shadowY:0.002, color:'white'},
wizards: {name:'wizards', text:'\u2122 & \u00a9 ' + date.getFullYear() + ' Wizards of the Coast', x:0.0614, y:0.921, width:0.8774, height:0.0172, oneLine:true, size:0.0172, align:'center', shadowX:0.0027, shadowY:0.002, color:'white'},
bottom: {text:'NOT FOR SALE CardConjurer.com', x:0.0614, y:0.94, width:0.8774, height:0.0143, oneLine:true, size:0.0143, align:'center', shadowX:0.0027, shadowY:0.002, color:'white'}
});
}