planar cards

This commit is contained in:
Kyle
2018-10-29 20:29:24 -07:00
parent 38fd185236
commit 0806ae0e6b
4 changed files with 59 additions and 17 deletions

View File

@@ -2,6 +2,7 @@
//Sets the correct values to anything that may have been changed from an out of the ordinary border
var eighthInfo = false
var m15Info = false
var planechaseInfo = false
var legendaryBorder = false
var nyxBorder = false
var miracleBorder = false

View File

@@ -23,20 +23,8 @@ var textX = 124
var textY = 535
var textWidth = 925
document.getElementById("textSize").value = 26
// //Power Toughness
// var ptFont = "39px belerenb"
// var ptFontSpacing = "0.3px"
// var ptTextX = 645
// var ptTextY = 936
// var ptX = 571
// var ptY = 929
// var ptWidth = 137
// var ptHeight = 75
//Bottom Info
var eighthInfo = false
var eighthInfoY = 992
var m15Info = true
var m15InfoY = 993
var planechaseInfo = true
//Set Symbol
var setSymbolY = 519
var setSymbolRight = 814
@@ -66,3 +54,44 @@ transparentBorder = true
//With all the new values in place, the program will update it's border images
finishTemplate()
//Any special functions go at the bottom
function bottomInfoPlanechase() {
card.textAlign = "left"
if (document.getElementById("checkboxArtistColor").checked == true) {
card.fillStyle = "black"
} else {
card.fillStyle = "white"
}
var bottomLineFirst = document.getElementById("inputNumber").value + " " + document.getElementById("inputSet").value + " \u00b7 " + document.getElementById("inputLanguage").value
var bottomLineSecond
var artistBrushShift = 0
if (document.getElementById("inputInfo").value != "") {
bottomLineSecond = "CC \u2014 " + document.getElementById("inputInfo").value
if (bottomLineSecond == "CC \u2014 secretcode") {
var date = new Date()
var year = date.getFullYear()
bottomLineSecond = "\u2122 & \u00a9 " + year + " Wizards of the Coast"
}
}
var artist = document.getElementById("inputArtist").value
//Artist
canvas.style.letterSpacing = "-0.2px"
card.font = "16px matrixbsc"
var artistLineWidth = (card.measureText(artist).width + 18) / 2
drawMask(card.fillStyle, canvas.width / 2 - artistLineWidth, 706, 15, 10, card, imgArtistBrush, false, false)
card.fillText(artist, canvas.width / 2 - artistLineWidth + 18, 704)
//Left and Right side
canvas.style.letterSpacing = "0px"
card.font = "16px relaymedium"
var firstWidth = card.measureText(bottomLineFirst).width + 15
canvas.style.letterSpacing = "-0.7px"
card.font = "13px mplantin"
var secondWidth = card.measureText(bottomLineSecond).width
canvas.style.letterSpacing = "0px"
card.font = "16px relaymedium"
card.fillText(bottomLineFirst, canvas.width / 2 - ((secondWidth + firstWidth) / 2) - 8, 717)
canvas.style.letterSpacing = "-0.7px"
card.font = "14px mplantin"
card.fillText(bottomLineSecond, canvas.width / 2 - ((secondWidth + firstWidth) / 2) + firstWidth - 8, 718)
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -1,7 +1,7 @@
<!DOCTYPE html5>
<html>
<head>
<title>Card Conjurer v1.3.4</title>
<title>Card Conjurer</title>
<script src="data/scripts/loadScript.js"></script>
<script src="data/scripts/loadImage.js"></script>
<script src="data/scripts/loadColors.js"></script>
@@ -111,6 +111,8 @@
Image
<input type="file" accept="image/*" onchange="loadImage(event, imgArt, true)" id="inputPicture"></input>
<br/>
<input type="text" placeholder="Or use a URL" onchange="imageURL(this, imgArt)"></input>
<br/>
Image Zoom
<input id="imageSize" type="number" value="100" step="0.1"></input>
<br/>
@@ -159,6 +161,8 @@
Custom Set Symbol
<input type="file" accept="image/*" onchange="loadImage(event, imgSetSymbol, true)" id="inputSetSymbol"></input>
<br/>
<input type="text" placeholder="Or use a URL" onchange="imageURL(this, imgSetSymbol)"></input>
<br/>
Scale Set Symbol
<input id="setSymbolSize" type="number" value="100" step="0.5"></input>
<br/><br/>
@@ -167,6 +171,8 @@
<br/>
<input type="file" accept="image/*" onchange="loadImage(event, imgWatermark, true)" id="inputWatermark"></input>
<br/>
<input type="text" placeholder="Or use a URL" onchange="imageURL(this, imgWatermark)"></input>
<br/>
Watermark Color
<br/>
<select id="watermarkColorSelection">
@@ -519,9 +525,10 @@ function cardClock() {
//m15 and 8th edition have different info at the bottom of the cards and require completely different functions
if (m15Info == true) {
bottomInfoM15()
}
if (eighthInfo == true) {
} else if (eighthInfo == true) {
bottomInfo8th()
}else if (planechaseInfo == true) {
bottomInfoPlanechase()
}
//A shiny foil overlay!
if(document.getElementById("checkboxFoil").checked == true) {
@@ -1102,6 +1109,11 @@ function loadSetSymbol() {
imgSetSymbol.src = "https://raw.githubusercontent.com/ImKyle4815/MTG-Set-Symbols/master/setSymbols/" + document.getElementById("setSymbolCode").value.toUpperCase() + "_" + document.getElementById("setSymbolRarity").value.toUpperCase() + ".png"
}
//Loads an image from URL
function imageURL(input, URL) {
URL.src = input.value
}
//Best for last - downloads the image!
function downloadCardImage(linkElement) {
var cardImageData = canvas.toDataURL()