Add makeDoubleSidedFace function
This commit is contained in:
parent
a2fa5f7bce
commit
5f102abeca
@ -77,6 +77,11 @@ def makeFace(baseImage, baseX, cardNum, deckType, cardFile, card):
|
|||||||
fig = makeSVG(path, card)
|
fig = makeSVG(path, card)
|
||||||
addCardToBase(fig, baseImage, baseX, cardNum)
|
addCardToBase(fig, baseImage, baseX, cardNum)
|
||||||
|
|
||||||
|
def makeDoubleSidedFace(baseImage, baseX, cardNum, deckType, cardFile,
|
||||||
|
cardFront, cardBack):
|
||||||
|
makeFace(baseImage, baseX, cardNum, deckType, cardFile, cardFront)
|
||||||
|
makeFace(baseImage, baseX, cardNum + 1, deckType, cardFile, cardBack)
|
||||||
|
|
||||||
def makeFaces(deckJson, outfile):
|
def makeFaces(deckJson, outfile):
|
||||||
baseX = math.ceil(math.sqrt(len(deckJson['deck']) + len(deckJson['character']) * 2))
|
baseX = math.ceil(math.sqrt(len(deckJson['deck']) + len(deckJson['character']) * 2))
|
||||||
baseImage = etree.ElementTree(
|
baseImage = etree.ElementTree(
|
||||||
@ -103,15 +108,13 @@ def makeFaces(deckJson, outfile):
|
|||||||
front["name"] = card["name"]
|
front["name"] = card["name"]
|
||||||
back = card["back"]
|
back = card["back"]
|
||||||
back["name"] = card["name"]
|
back["name"] = card["name"]
|
||||||
makeFace(baseImage, baseX, cardNum, deckType, "character.svg", front)
|
makeDoubleSidedFace(baseImage, baseX, cardNum, deckType,
|
||||||
cardNum += 1
|
"character.svg", front, back)
|
||||||
makeFace(baseImage, baseX, cardNum, deckType, "character.svg", back)
|
cardNum += 2
|
||||||
cardNum += 1
|
|
||||||
|
|
||||||
makeFace(baseImage, baseX, cardNum, deckType, "instructions.svg", front)
|
makeDoubleSidedFace(baseImage, baseX, cardNum, deckType,
|
||||||
cardNum += 1
|
"instructions.svg", front, back)
|
||||||
makeFace(baseImage, baseX, cardNum, deckType, "instructions.svg", back)
|
cardNum += 2
|
||||||
cardNum += 1
|
|
||||||
|
|
||||||
|
|
||||||
# Make a card for each card
|
# Make a card for each card
|
||||||
|
Reference in New Issue
Block a user