mirror of
https://github.com/Investigamer/cardconjurer.git
synced 2025-07-27 05:14:53 -05:00
fix
This commit is contained in:
@@ -24,7 +24,5 @@ imgTitleMask.load("data/borders/fullArtLandM15/imgTitleMask.png")
|
||||
imgTypeMask.load("data/borders/fullArtLandM15/imgTypeMask.png")
|
||||
//Loads the Colors
|
||||
loadColors("white-White,blue-Blue,black-Black,red-Red,green-Green,gold-Gold,colorless-Colorless")
|
||||
//Runs the things!
|
||||
sectionTextFunction()
|
||||
sectionFrameFunction()
|
||||
sectionOtherFunction()
|
||||
//Finishes loading the border style
|
||||
finishChangingBorder()
|
@@ -30,7 +30,5 @@ imgFrameMask.load("data/borders/fullArtLandUnstable/imgFrameMask.png")
|
||||
imgPinlineMask.load("data/borders/fullArtLandUnstable/imgPinlineMask.png")
|
||||
//Loads the Colors
|
||||
loadColors("white-White,blue-Blue,black-Black,red-Red,green-Green,gold-Gold,colorless-Colorless")
|
||||
//Runs the things!
|
||||
sectionTextFunction()
|
||||
sectionFrameFunction()
|
||||
sectionOtherFunction()
|
||||
//Finishes loading the border style
|
||||
finishChangingBorder()
|
@@ -3,7 +3,5 @@
|
||||
//============================================//
|
||||
//Loads the colors
|
||||
loadColors("white-White,blue-Blue,black-Black,red-Red,green-Green,gold-Gold,artifact-Artifact,colorless-Colorless,vehicle-Vehicle,clear-Clear,whiteLand-White Land,blueLand-Blue Land,blackLand-Black Land,redLand-Red Land,greenLand-Green Land,goldLand-Gold Land,colorlessLand-Colorless Land")
|
||||
//Runs the things!
|
||||
sectionTextFunction()
|
||||
sectionFrameFunction()
|
||||
sectionOtherFunction()
|
||||
//Finishes loading the border style
|
||||
finishChangingBorder()
|
||||
|
@@ -39,11 +39,9 @@ imgArtMask.load("data/borders/miniPlane/imgArtMask.png")
|
||||
imgFrameMask.load("data/borders/miniPlane/imgFrameMask.png")
|
||||
imgBorderMask.load("data/borders/miniPlane/imgBorderMask.png")
|
||||
//Loads the Colors
|
||||
loadColors("white-White")
|
||||
//Runs the things!
|
||||
sectionTextFunction()
|
||||
sectionFrameFunction()
|
||||
sectionOtherFunction()
|
||||
loadColors("white-Regular")
|
||||
//Finishes loading the border style
|
||||
finishChangingBorder()
|
||||
|
||||
function bottomInfoPlanechase() {
|
||||
var infoNumber = document.getElementById("inputInfoNumber").value
|
||||
|
@@ -9,9 +9,8 @@ cardData.miracle = false
|
||||
cardData.nyx = false
|
||||
cardData.legendary = false
|
||||
cardData.creature = false
|
||||
cardData.rulesBox = false
|
||||
cardData.titleTypeBoxes = false
|
||||
cardData.rareStamp = false
|
||||
cardData.pinline = false
|
||||
//Specific Values
|
||||
cardData.manaSymbolDirection = "none"
|
||||
cardData.titleAlignment = "center"
|
||||
@@ -47,10 +46,8 @@ imgTypeMask.load("data/borders/plane/imgTypeMask.png")
|
||||
imgTitleMask.load("data/borders/plane/imgTitleMask.png")
|
||||
//Loads the Colors
|
||||
loadColors("white-Regular,high-High,mid-Middle,low-Low,none-Single")
|
||||
//Runs the things!
|
||||
sectionTextFunction()
|
||||
sectionFrameFunction()
|
||||
sectionOtherFunction()
|
||||
//Finishes loading the border style
|
||||
finishChangingBorder()
|
||||
|
||||
function bottomInfoPlanechase() {
|
||||
var infoNumber = document.getElementById("inputInfoNumber").value
|
||||
|
@@ -45,10 +45,8 @@ loadColors("white-White,blue-Blue,black-Black,red-Red,green-Green,gold-Gold,arti
|
||||
document.getElementById("inputCreatureColor").value = "#ffffff"
|
||||
cardData.specialImageA = true
|
||||
cardData.specialImageB = true
|
||||
//Runs the things!
|
||||
sectionTextFunction()
|
||||
sectionFrameFunction()
|
||||
sectionOtherFunction()
|
||||
//Finishes loading the border style
|
||||
finishChangingBorder()
|
||||
|
||||
var abilityLineThickness = cheight(6)
|
||||
var abilityLines = []
|
||||
|
@@ -24,7 +24,5 @@ imgLegendary.load("none", cwidth(26), cheight(20), cwidth(697), cheight(112))
|
||||
imgLegendaryRight.load("none", cwidth(26), cheight(20), cwidth(697), cheight(112))
|
||||
//Loads the Colors
|
||||
loadColors("white-White,blue-Blue,black-Black,red-Red,green-Green,gold-Gold,artifact-Artifact,colorless-Colorless")
|
||||
//Runs the things!
|
||||
sectionTextFunction()
|
||||
sectionFrameFunction()
|
||||
sectionOtherFunction()
|
||||
//Finishes loading the border style
|
||||
finishChangingBorder()
|
@@ -27,7 +27,5 @@ imgLegendary.load("none", cwidth(26), cheight(20), cwidth(697), cheight(112))
|
||||
imgLegendaryRight.load("none", cwidth(26), cheight(20), cwidth(697), cheight(112))
|
||||
//Loads the Colors
|
||||
loadColors("white-White,blue-Blue,black-Black,red-Red,green-Green,gold-Gold,artifact-Artifact,colorless-Colorless")
|
||||
//Runs the things!
|
||||
sectionTextFunction()
|
||||
sectionFrameFunction()
|
||||
sectionOtherFunction()
|
||||
//Finishes loading the border style
|
||||
finishChangingBorder()
|
@@ -27,7 +27,5 @@ imgLegendary.load("none", cwidth(26), cheight(20), cwidth(697), cheight(112))
|
||||
imgLegendaryRight.load("none", cwidth(26), cheight(20), cwidth(697), cheight(112))
|
||||
//Loads the Colors
|
||||
loadColors("white-White,blue-Blue,black-Black,red-Red,green-Green,gold-Gold,artifact-Artifact,colorless-Colorless")
|
||||
//Runs the things!
|
||||
sectionTextFunction()
|
||||
sectionFrameFunction()
|
||||
sectionOtherFunction()
|
||||
//Finishes loading the border style
|
||||
finishChangingBorder()
|
@@ -1,57 +0,0 @@
|
||||
//M15 Border
|
||||
//Anything to do with...
|
||||
//Loading Images
|
||||
var artX = 56
|
||||
var artY = 125
|
||||
imgMultiMask.src = borderPath + "multiMask.png"
|
||||
imgFrameMask.src = borderPath + "frameMask.png"
|
||||
imgLegendFrameMask.src = borderPath + "legendFrameMask.png"
|
||||
imgBorderMask.src = borderPath + "borderMask.png"
|
||||
//Card Title
|
||||
document.getElementById("inputTitleColor").value = "#ffe886"
|
||||
var titleFont = "40px belerenbsc" //40
|
||||
var titleFontSpacing = "0.15px" //0.15
|
||||
var titleX = 374.5 //62
|
||||
var titleY = 59 //59
|
||||
var titleAlign = "center"
|
||||
//Mana Cost
|
||||
var manaCostRadius = 17.5 //17.5
|
||||
var manaCostX = 657 //657
|
||||
var manaCostY = 59 //59
|
||||
//Card Type
|
||||
var typeFont = "33.5px belerenb" //33.5
|
||||
var typeFontSpacing = "0.05px" //0.05
|
||||
var typeX = 60 //60
|
||||
var typeY = 868 //868
|
||||
// Rules/Flavor Text
|
||||
var textFont = "px mplantin"
|
||||
var textFontSpacing = 0.7 //0.7
|
||||
var textX = 66 //66
|
||||
var textY = 266 //656
|
||||
var textWidth = 682 //682
|
||||
//Power Toughness
|
||||
var ptFont = "39px belerenb" //39
|
||||
var ptFontSpacing = "0.3px" //0.3
|
||||
var ptTextX = 645 //645
|
||||
var ptTextY = 939 //939
|
||||
imgBorderCreature.imgValues(571, 926, 137, 75)
|
||||
//Bottom Info
|
||||
var infoY = 999 //999
|
||||
//Set Symbol
|
||||
var setSymbolY = 883 //616
|
||||
var setSymbolRight = 693 //693
|
||||
var setSymbolWidth = 84 //77
|
||||
var setSymbolHeight = 44 //44
|
||||
//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
|
||||
//Things The Card Can Do
|
||||
legendaryBorder = true
|
||||
imgBorderLegendary.imgValues(26, 20, 697, 112, "imgSecondBorderLegendary")
|
||||
nyxBorder = true
|
||||
imgBorderNyx.imgValues(30, 30, 689, 643, "imgSecondBorderNyx")
|
||||
//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 = "bottomInfoM15"
|
39
data/main.js
39
data/main.js
@@ -29,7 +29,7 @@ function scrollFunction() {
|
||||
}
|
||||
|
||||
function textAreaKeyPressed() {
|
||||
if (event.key == "Enter" || event.key == "Return") {
|
||||
if (event.key == "Enter" || event.key == "Return" || event.keyCode == 13) {
|
||||
setTimeout(function() {
|
||||
cursorIndex = document.getElementById("inputText").selectionStart
|
||||
document.getElementById("inputText").value = document.getElementById("inputText").value.slice(0, cursorIndex) + "{line}" + document.getElementById("inputText").value.slice(cursorIndex, 0)
|
||||
@@ -75,9 +75,13 @@ var cardData = {}
|
||||
Object.assign(cardData, defaultCardData)
|
||||
//Function that restores image values for various things :)
|
||||
function backToDefault(version) {
|
||||
//Fixes canvas size
|
||||
if (cardWidth != 750 || cardHeight != 1050) {
|
||||
changeCanvasSize(750, 1050)
|
||||
}
|
||||
//Default card data, correct card version
|
||||
Object.assign(cardData, defaultCardData)
|
||||
cardData.version = version
|
||||
//Default image values
|
||||
imgLegendary.load("none", cwidth(20), cheight(20), cwidth(714), cheight(186))
|
||||
imgLegendaryRight.load("none", cwidth(20), cheight(20), cwidth(714), cheight(186))
|
||||
@@ -88,16 +92,13 @@ function backToDefault(version) {
|
||||
imgNyxRight.load("none", cwidth(30), cheight(30), cwidth(690), cheight(586))
|
||||
imgMiracle.load("none", cwidth(30), cheight(30), cwidth(689), cheight(511))
|
||||
imgMiracleRight.load("none", cwidth(30), cheight(30), cwidth(689), cheight(511))
|
||||
//Default card data, correct card version
|
||||
Object.assign(cardData, defaultCardData)
|
||||
cardData.version = version
|
||||
//Default masks
|
||||
for (var i = 0; i < frameMaskList.length; i++) {
|
||||
if (window[frameMaskList[i]].src.includes("data/borders/m15/" + frameMaskList[i] + ".png") == false) {
|
||||
window[frameMaskList[i]].load("data/borders/m15/" + frameMaskList[i] + ".png")
|
||||
}
|
||||
}
|
||||
//Loads correct frame images
|
||||
//Loads default frame images
|
||||
for (var i = 0; i < frameImageList.length; i++) {
|
||||
window[frameImageList[i]].load("data/borders/" + cardData.version + "/white/frame.png")
|
||||
}
|
||||
@@ -108,6 +109,17 @@ function backToDefault(version) {
|
||||
//Runs the finishing script
|
||||
loadScript('data/borders/' + version + '/border.js')
|
||||
}
|
||||
function finishChangingBorder() {
|
||||
loadLegendaryImages()
|
||||
loadRareStampImages()
|
||||
loadMiracleImages()
|
||||
loadNyxImages()
|
||||
changePowerToughnessColor()
|
||||
//Runs the three main drawing functions
|
||||
sectionTextFunction()
|
||||
sectionFrameFunction()
|
||||
sectionOtherFunction()
|
||||
}
|
||||
|
||||
//Set up canvases
|
||||
var canvas = document.getElementById("canvas")
|
||||
@@ -157,10 +169,8 @@ CanvasRenderingContext2D.prototype.mask = function(image, masks, color, maskOpac
|
||||
maskContext.globalCompositeOperation = "source-in"
|
||||
}
|
||||
maskContext.globalAlpha = maskOpacity
|
||||
|
||||
if (image != "none") {
|
||||
maskContext.drawImage(image, image.xVal, image.yVal, image.wVal, image.hVal)
|
||||
// console.log(image.yVal)
|
||||
maskContext.drawImage(image, image.xVal || 0, image.yVal || 0, image.wVal || cardWidth, image.hVal || cardHeight)
|
||||
}
|
||||
//If a color is provided, fill that in too.
|
||||
if (color != undefined && color != "none") {
|
||||
@@ -450,10 +460,6 @@ function whiteToTransparent(targetImage) {
|
||||
function createImage(name, section) {
|
||||
//Create the image and give it default values
|
||||
window[name] = new Image()
|
||||
window[name].xVal = 0
|
||||
window[name].yVal = 0
|
||||
window[name].wVal = cardWidth
|
||||
window[name].hVal = cardHeight
|
||||
window[name].name = name
|
||||
if (section != undefined) {
|
||||
window[name].cardSection = section
|
||||
@@ -492,10 +498,11 @@ Image.prototype.load = function(source, x, y, w, h) {
|
||||
this.loadingStatus = true
|
||||
this.src = source
|
||||
}
|
||||
if (x != undefined) {this.xVal = x} else /*if (this.xVal == undefined)*/ {this.xVal = 0}
|
||||
if (y != undefined) {this.yVal = y} else /*if (this.yVal == undefined)*/ {this.yVal = 0}
|
||||
if (w != undefined) {this.wVal = w} else /*if (this.wVal == undefined)*/ {this.wVal = cardWidth}
|
||||
if (h != undefined) {this.hVal = h} else /*if (this.hVal == undefined)*/ {this.hVal = cardHeight}
|
||||
|
||||
if (x != undefined) {this.xVal = x}
|
||||
if (y != undefined) {this.yVal = y}
|
||||
if (w != undefined) {this.wVal = w}
|
||||
if (h != undefined) {this.hVal = h}
|
||||
}
|
||||
|
||||
//Loads images via URL
|
||||
|
Reference in New Issue
Block a user