pw
BIN
data/borders/planeswalker/artMask.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
data/borders/planeswalker/artifact/altFrame.png
Normal file
After Width: | Height: | Size: 159 KiB |
BIN
data/borders/planeswalker/artifact/frame.png
Normal file
After Width: | Height: | Size: 155 KiB |
BIN
data/borders/planeswalker/artifact/pt.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
data/borders/planeswalker/artifact/stamp.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
data/borders/planeswalker/black/altFrame.png
Normal file
After Width: | Height: | Size: 194 KiB |
BIN
data/borders/planeswalker/black/frame.png
Normal file
After Width: | Height: | Size: 195 KiB |
BIN
data/borders/planeswalker/black/pt.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
data/borders/planeswalker/black/stamp.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
data/borders/planeswalker/blue/altFrame.png
Normal file
After Width: | Height: | Size: 264 KiB |
BIN
data/borders/planeswalker/blue/frame.png
Normal file
After Width: | Height: | Size: 266 KiB |
BIN
data/borders/planeswalker/blue/pt.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
data/borders/planeswalker/blue/stamp.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
140
data/borders/planeswalker/border.js
Normal file
@@ -0,0 +1,140 @@
|
||||
//============================================//
|
||||
// M15 Border //
|
||||
//============================================//
|
||||
//General Booleans
|
||||
cardData.miracle = false
|
||||
cardData.nyx = false
|
||||
cardData.legendary = false
|
||||
// cardData.creature = false
|
||||
// cardData.rulesBox = false
|
||||
cardData.rareStamp = false
|
||||
//Specific Values
|
||||
cardData.textX = cwidth(134)
|
||||
cardData.textY = cheight(656)
|
||||
cardData.textRight = cwidth(682)
|
||||
cardData.cardArtX = cwidth(52)
|
||||
cardData.cardArtY = cheight(106)
|
||||
cardData.titleFontSize = cwidth(40)
|
||||
cardData.titleX = cwidth(62)
|
||||
cardData.titleY = cheight(79)
|
||||
cardData.manaSymbolY = cheight(46)
|
||||
cardData.ptBoxX = cwidth(599)
|
||||
cardData.ptBoxY = cheight(922)
|
||||
cardData.ptBoxWidth = cwidth(120)
|
||||
cardData.ptBoxHeight = cheight(78)
|
||||
cardData.ptX = cwidth(657)
|
||||
cardData.ptY = cheight(974)
|
||||
cardData.watermarkY = cheight(805)
|
||||
cardData.watermarkWidth = cwidth(520)
|
||||
cardData.watermarkHeight = cheight(250)
|
||||
cardData.setSymbolY = cheight(618)
|
||||
cardData.setSymbolRight = cwidth(695)
|
||||
//Images
|
||||
imgPowerToughness.load("data/borders/planeswalker/white/pt.png")
|
||||
imgArtMask.load("data/borders/planeswalker/imgArtMask.png")
|
||||
// imgFrameMask.load("data/borders/fullArtLandM15/imgFrameMask.png")
|
||||
imgPinlineMask.load("data/borders/planeswalker/imgPinlineMask.png")
|
||||
imgTitleMask.load("data/borders/planeswalker/imgTitleMask.png")
|
||||
imgTypeMask.load("data/borders/planeswalker/imgTypeMask.png")
|
||||
imgAbilityLineEven.load("data/borders/planeswalker/imgAbilityLineEven.png")
|
||||
imgAbilityLineOdd.load("data/borders/planeswalker/imgAbilityLineOdd.png")
|
||||
//Loads the Colors
|
||||
loadColors("white-White,blue-Blue,black-Black,red-Red,green-Green,gold-Gold,colorless-Colorless")
|
||||
//Anything special
|
||||
document.getElementById("inputCreatureColor").value = "#ffffff"
|
||||
cardData.specialImageA = true
|
||||
cardData.specialImageB = true
|
||||
//Runs the things!
|
||||
sectionTextFunction()
|
||||
sectionFrameFunction()
|
||||
sectionOtherFunction()
|
||||
|
||||
var abilityLineThickness = cheight(6)
|
||||
var abilityLines = []
|
||||
function planeswalkerAbilityLines() {
|
||||
abilityLines = []
|
||||
if (document.getElementById("inputAbilityLine1").value > 0) {abilityLines[abilityLines.length] = parseInt(document.getElementById("inputAbilityLine1").value)}
|
||||
if (document.getElementById("inputAbilityLine2").value > 0) {abilityLines[abilityLines.length] = parseInt(document.getElementById("inputAbilityLine2").value)}
|
||||
if (document.getElementById("inputAbilityLine3").value > 0) {abilityLines[abilityLines.length] = parseInt(document.getElementById("inputAbilityLine3").value)}
|
||||
if (document.getElementById("inputAbilityLine4").value > 0) {abilityLines[abilityLines.length] = parseInt(document.getElementById("inputAbilityLine4").value)}
|
||||
specialAContext.clearRect(0, 0, cardWidth, cardHeight)
|
||||
//Start with the background
|
||||
var abilityLineCurrentY = cheight(655) - abilityLineThickness
|
||||
for (var i = 0; i < abilityLines.length; i ++) {
|
||||
//determine the correct color
|
||||
if (i % 2 === 0) {
|
||||
specialAContext.fillStyle = "#95959595"
|
||||
} else {
|
||||
specialAContext.fillStyle = "#6a6a6a6a"
|
||||
}
|
||||
if (i == abilityLines.length - 1) {
|
||||
//This is the last line
|
||||
specialAContext.fillRect(cwidth(50), abilityLineCurrentY + abilityLineThickness, cwidth(649), cardHeight - abilityLineCurrentY - cheight(89) - abilityLineThickness)
|
||||
} else {
|
||||
specialAContext.fillRect(cwidth(50), abilityLineCurrentY + abilityLineThickness, cwidth(649), abilityLines[i] - abilityLineThickness * 2)
|
||||
if (i % 2 === 0) {
|
||||
specialAContext.drawImage(imgAbilityLineOdd, cwidth(92), abilityLineCurrentY + abilityLines[i] - abilityLineThickness, cwidth(599), abilityLineThickness * 2)
|
||||
} else {
|
||||
specialAContext.drawImage(imgAbilityLineEven, cwidth(92), abilityLineCurrentY + abilityLines[i] - abilityLineThickness, cwidth(599), abilityLineThickness * 2)
|
||||
}
|
||||
}
|
||||
abilityLineCurrentY += abilityLines[i]
|
||||
}
|
||||
planeswalkerAbilityIcons()
|
||||
}
|
||||
function planeswalkerAbilityIcons() {
|
||||
switch (abilityLines.length) {
|
||||
case 4:
|
||||
abilityIconSpacing = 75
|
||||
abilityIconStartShift = 12
|
||||
break;
|
||||
case 3:
|
||||
abilityIconSpacing = 94
|
||||
abilityIconStartShift = 0
|
||||
break;
|
||||
case 2:
|
||||
abilityIconSpacing = 125
|
||||
abilityIconStartShift = -32
|
||||
break;
|
||||
case 1:
|
||||
abilityIconSpacing = 0
|
||||
abilityIconStartShift = -100
|
||||
break;
|
||||
}
|
||||
specialBContext.clearRect(0, 0, cardWidth, cardHeight)
|
||||
//Now the loyalty ability icons
|
||||
var abilityLineCurrentY = cheight(705) - abilityIconStartShift
|
||||
for (var i = 0; i < abilityLines.length; i ++) {
|
||||
var loyaltyValue = document.getElementById("inputAbilityValue" + i).value
|
||||
if (loyaltyValue != "") {
|
||||
specialBContext.fillStyle = "white"
|
||||
specialBContext.textAlign = "center"
|
||||
specialBContext.font = cwidth(31) + "px belerenbsc"
|
||||
if (loyaltyValue.charAt(0) == "-") {
|
||||
specialBContext.drawImage(manaSymbolImageList[58], cwidth(35), abilityLineCurrentY - cheight(28), cwidth(86), cheight(64))
|
||||
specialBContext.fillText(loyaltyValue, cwidth(76), abilityLineCurrentY + cheight(8))
|
||||
specialBContext.font = cwidth(38) + "px mplantin"
|
||||
specialBContext.fillStyle = "black"
|
||||
specialBContext.fillText(":", cwidth(125), abilityLineCurrentY + cheight(5))
|
||||
} else if (loyaltyValue.charAt(0) == "+") {
|
||||
specialBContext.drawImage(manaSymbolImageList[59], cwidth(35), abilityLineCurrentY - cheight(36), cwidth(86), cheight(63))
|
||||
specialBContext.fillText(loyaltyValue, cwidth(76), abilityLineCurrentY + cheight(9))
|
||||
specialBContext.font = cwidth(38) + "px mplantin"
|
||||
specialBContext.fillStyle = "black"
|
||||
specialBContext.fillText(":", cwidth(125), abilityLineCurrentY + cheight(7))
|
||||
} else {
|
||||
specialBContext.drawImage(manaSymbolImageList[60], cwidth(35), abilityLineCurrentY - cheight(27), cwidth(85), cheight(56))
|
||||
specialBContext.fillText(loyaltyValue, cwidth(76), abilityLineCurrentY + cheight(9))
|
||||
specialBContext.font = cwidth(38) + "px mplantin"
|
||||
specialBContext.fillStyle = "black"
|
||||
specialBContext.fillText(":", cwidth(125), abilityLineCurrentY + cheight(5))
|
||||
}
|
||||
|
||||
}
|
||||
abilityLineCurrentY += abilityIconSpacing
|
||||
}
|
||||
drawCard()
|
||||
}
|
||||
|
||||
setTimeout(function() {planeswalkerAbilityLines()}, 500)
|
||||
document.getElementById("cmmPlaneswalker").style.display = "block"
|
BIN
data/borders/planeswalker/borderMask.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
data/borders/planeswalker/colorless/altFrame.png
Normal file
After Width: | Height: | Size: 182 KiB |
BIN
data/borders/planeswalker/colorless/frame.png
Normal file
After Width: | Height: | Size: 183 KiB |
BIN
data/borders/planeswalker/colorless/pt.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
data/borders/planeswalker/colorless/stamp.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
data/borders/planeswalker/frameMask.png
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
data/borders/planeswalker/gold/altFrame.png
Normal file
After Width: | Height: | Size: 233 KiB |
BIN
data/borders/planeswalker/gold/frame.png
Normal file
After Width: | Height: | Size: 232 KiB |
BIN
data/borders/planeswalker/gold/pt.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
data/borders/planeswalker/gold/stamp.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
data/borders/planeswalker/green/altFrame.png
Normal file
After Width: | Height: | Size: 200 KiB |
BIN
data/borders/planeswalker/green/frame.png
Normal file
After Width: | Height: | Size: 199 KiB |
BIN
data/borders/planeswalker/green/pt.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
data/borders/planeswalker/green/stamp.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
data/borders/planeswalker/imgAbilityLineEven.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
data/borders/planeswalker/imgAbilityLineOdd.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
data/borders/planeswalker/imgArtMask.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
data/borders/planeswalker/imgPinlineMask.png
Normal file
After Width: | Height: | Size: 7.0 KiB |
BIN
data/borders/planeswalker/imgTitleMask.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
data/borders/planeswalker/imgTypeMask.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
data/borders/planeswalker/multiGradient.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
data/borders/planeswalker/multiMask.png
Normal file
After Width: | Height: | Size: 6.7 KiB |
145
data/borders/planeswalker/old.js
Normal file
@@ -0,0 +1,145 @@
|
||||
//Planeswalker Border
|
||||
//Anything to do with...
|
||||
//Loading Images
|
||||
imgMultiGradient.src = borderPath + "multiGradient.png"
|
||||
imgMultiMask.src = borderPath + "multiMask.png"
|
||||
imgFrameMask.src = borderPath + "frameMask.png"
|
||||
imgRareStampMask.src = borderPath + "rareStampMask.png"
|
||||
imgBorderMask.src = borderPath + "borderMask.png"
|
||||
imgAbilityLineOdd.src = borderPath + "abilityLineOdd.png"
|
||||
imgAbilityLineEven.src = borderPath + "abilityLineEven.png"
|
||||
document.getElementById("textSize").value = 33
|
||||
document.getElementById("inputCreatureColor").value = "#ffffff"
|
||||
//Card Title
|
||||
var titleFont = "40px belerenb" //40
|
||||
var titleFontSpacing = "-0.1px" //-0.1
|
||||
var titleX = 62 //62
|
||||
var titleY = 48 //48
|
||||
//Mana Cost
|
||||
var manaCostRadius = 17.5 //17.5
|
||||
var manaCostX = 657 //657
|
||||
var manaCostY = 46 //46
|
||||
//Card Type
|
||||
var typeFont = "33.5px belerenb" //33.5
|
||||
var typeFontSpacing = "0.05px" //0.05
|
||||
var typeX = 62 //62
|
||||
var typeY = 602 //602
|
||||
//Rules/Flavor Text
|
||||
var textFont = "px mplantin"
|
||||
var textFontSpacing = -0.4 //-0.4
|
||||
var textX = 134 //134
|
||||
var textY = 656 //656
|
||||
var textWidth = 682 //682
|
||||
//Power Toughness
|
||||
var ptFont = "39px belerenb" //39
|
||||
var ptFontSpacing = "0.3px" //0.3
|
||||
var ptTextX = 655 //655
|
||||
var ptTextY = 940 //940
|
||||
imgBorderCreature.imgValues(598, 920, 118, 75)
|
||||
//Bottom Info
|
||||
var infoY = 999 //993
|
||||
//Set Symbol
|
||||
var setSymbolY = 615 //615
|
||||
var setSymbolRight = 695 //695
|
||||
var setSymbolWidth = 90 //90
|
||||
var setSymbolHeight = 42 //42
|
||||
//Watermark
|
||||
var watermarkWidth = 520 //520
|
||||
var watermarkHeight = 250 //250
|
||||
var watermarkY = 805 //805
|
||||
//Rare Stamp
|
||||
var rareStampY = 955 //955
|
||||
//Color Options
|
||||
loadColors("white-White,blue-Blue,black-Black,red-Red,green-Green,gold-Gold,colorless-Colorless,artifact-Artifact")
|
||||
document.getElementById("secondColorSelection").innerHTML = document.getElementById("colorSelection").innerHTML
|
||||
document.getElementById("thirdColorSelection").innerHTML = document.getElementById("colorSelection").innerHTML
|
||||
//"Being a Planeswalker is being able to do what a card do"
|
||||
// —Unknown AP English Student
|
||||
stampBorder = true
|
||||
var artX = 52
|
||||
var artY = 106
|
||||
//With all the new values in place, the program will update it's border images
|
||||
finishTemplate()
|
||||
//Any special functions go at the bottom
|
||||
var uniqueFunctionName = "planeswalkerCustomFunction"
|
||||
|
||||
function planeswalkerCustomFunction() {
|
||||
//Bottom info is important
|
||||
bottomInfoM15()
|
||||
//But now it has to draw/write the loyalty things!
|
||||
var abilityLineY = 650
|
||||
for (i = 0; i < abilityLines.length; i ++) {
|
||||
var loyaltyValue = document.getElementById("abilityValue" + i).value
|
||||
if (loyaltyValue != "") {
|
||||
card.fillStyle = "white"
|
||||
card.textAlign = "center"
|
||||
card.font = "31px belerenbsc"
|
||||
if (loyaltyValue.charAt(0) == "-") {
|
||||
card.drawImage(manaSymbolImages[58], 34, abilityLineY + abilityLines[i] / 2 - 28, 84, 64)
|
||||
card.fillText(loyaltyValue, 76, abilityLineY + abilityLines[i] / 2 - 17 + textBaselineShift[0] * card.font.split("px")[0])
|
||||
} else if (loyaltyValue.charAt(0) == "+") {
|
||||
card.drawImage(manaSymbolImages[59], 34, abilityLineY + abilityLines[i] / 2 - 38, 82, 62)
|
||||
card.fillText(loyaltyValue, 74, abilityLineY + abilityLines[i] / 2 - 19 + textBaselineShift[0] * card.font.split("px")[0])
|
||||
} else {
|
||||
card.drawImage(manaSymbolImages[60], 34, abilityLineY + abilityLines[i] / 2 - 28, 82, 56)
|
||||
card.fillText(loyaltyValue, 74, abilityLineY + abilityLines[i] / 2 - 16 + textBaselineShift[0] * card.font.split("px")[0])
|
||||
}
|
||||
card.font = "37px mplantin"
|
||||
card.fillStyle = "black"
|
||||
card.fillText(":", 124, abilityLineY + abilityLines[i] / 2 - 23 + textBaselineShift[0] * card.font.split("px")[0])
|
||||
}
|
||||
abilityLineY += abilityLines[i]
|
||||
}
|
||||
}
|
||||
|
||||
var savedFrameMask = new Image()
|
||||
savedFrameMask.src = borderPath + "frameMask.png"
|
||||
var abilityLineCanvas = document.createElement("canvas")
|
||||
abilityLineCanvas.width = cardWidth
|
||||
abilityLineCanvas.height = cardHeight
|
||||
var abilityLineContext = abilityLineCanvas.getContext("2d")
|
||||
var abilityLines = []
|
||||
function planeswalkerAbilityLines() {
|
||||
abilityLines = []
|
||||
if (document.getElementById("abilityLine1").value > 0) {abilityLines[abilityLines.length] = parseInt(document.getElementById("abilityLine1").value)}
|
||||
if (document.getElementById("abilityLine2").value > 0) {abilityLines[abilityLines.length] = parseInt(document.getElementById("abilityLine2").value)}
|
||||
if (document.getElementById("abilityLine3").value > 0) {abilityLines[abilityLines.length] = parseInt(document.getElementById("abilityLine3").value)}
|
||||
if (document.getElementById("abilityLine4").value > 0) {abilityLines[abilityLines.length] = parseInt(document.getElementById("abilityLine4").value)}
|
||||
abilityLineContext.clearRect(0, 0, cardWidth, cardHeight)
|
||||
var abilityLineY = 645
|
||||
for (i = 0; i < abilityLines.length; i ++) {
|
||||
if (i == abilityLines.length - 1) {
|
||||
// abilityLines[i] += cardHeight - abilityLines[i]
|
||||
if (i % 2 === 0) {
|
||||
abilityLineContext.fillStyle = "#95959595"
|
||||
} else {
|
||||
abilityLineContext.fillStyle = "#6a6a6a6a"
|
||||
}
|
||||
abilityLineContext.fillRect(50, abilityLineY + 5, cardWidth - 100, cardHeight - abilityLineY - 90)
|
||||
} else {
|
||||
if (i % 2 === 0) {
|
||||
abilityLineContext.fillStyle = "#95959595"
|
||||
abilityLineContext.drawImage(imgAbilityLineOdd, 93, abilityLineY + abilityLines[i] - 5, 596, 10)
|
||||
} else {
|
||||
abilityLineContext.fillStyle = "#6a6a6a6a"
|
||||
abilityLineContext.drawImage(imgAbilityLineEven, 93, abilityLineY + abilityLines[i] - 5, 596, 10)
|
||||
}
|
||||
abilityLineContext.fillRect(50, abilityLineY + 5, cardWidth - 100, abilityLines[i] - 10)
|
||||
}
|
||||
abilityLineY += abilityLines[i]
|
||||
}
|
||||
abilityLineContext.clearRect(0, 0, 93, cardHeight)
|
||||
abilityLineContext.drawImage(savedFrameMask, 0, 0, cardWidth, cardHeight)
|
||||
imgFrameMask.src = abilityLineCanvas.toDataURL()
|
||||
imgFrameMask.hasToLoad = true
|
||||
}
|
||||
imgFrameMask.onload = function() {
|
||||
if (imgFrameMask.hasToLoad == true) {
|
||||
imgFrameMask.hasToLoad = false
|
||||
createBorder()
|
||||
}
|
||||
}
|
||||
//Reveals the planeswalker card manipulation menu section
|
||||
document.getElementById("cmmPlaneswalker").style.display = "block"
|
||||
//After a second the first ability lines will be generated
|
||||
setTimeout(function(){if (document.getElementById("borderSelection").value == "planeswalker/") {planeswalkerAbilityLines()}}, 1000)
|
BIN
data/borders/planeswalker/rareStampMask.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
data/borders/planeswalker/red/altFrame.png
Normal file
After Width: | Height: | Size: 229 KiB |
BIN
data/borders/planeswalker/red/frame.png
Normal file
After Width: | Height: | Size: 228 KiB |
BIN
data/borders/planeswalker/red/pt.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
data/borders/planeswalker/red/stamp.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
data/borders/planeswalker/white/altFrame.png
Normal file
After Width: | Height: | Size: 214 KiB |
BIN
data/borders/planeswalker/white/frame.png
Normal file
After Width: | Height: | Size: 215 KiB |
BIN
data/borders/planeswalker/white/pt.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
data/borders/planeswalker/white/ref.png
Normal file
After Width: | Height: | Size: 264 KiB |
BIN
data/borders/planeswalker/white/stamp.png
Normal file
After Width: | Height: | Size: 2.0 KiB |