-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cardconjurer is a generic card editor that can support MTG pretty well. Changes: - Added Model entities - Added CLI to parse and render a card
- Loading branch information
Showing
22 changed files
with
2,341 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,7 @@ Plans | |
|
||
users/installation | ||
users/cli | ||
users/cardconjurer | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
=============== | ||
Card Generation | ||
=============== | ||
|
||
**mightstone** provides a CardConjurer file format renderer (and parser). As for everything in mightstone, data is parsed into Pydantic objects, and accessed asynchronously. | ||
|
||
mightstone don’t support card alteration from an existing json file for the moment. | ||
|
||
.. literalinclude:: ../../../examples/card_conjurer.py | ||
:language: python | ||
|
||
It is possible to generate your image from our CLI interface: | ||
|
||
.. code-block:: bash | ||
python -m src.mightstone.cli cardconjurer render ./tests/mightstone/services/cardconjurer/Dimirova\ Smiley.json ./out.png --base-url="https://card-conjurer-assets.s3.us-east-1.amazonaws.com" | ||
Assets and template availability | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
By design CardConjurer tries to decentralize template from their core tool. As is, Card Conjurer does not provide any mean to generate Magic The Gathering alike cards. Instead, you need to build your own template (or get your hands on) that reproduces MTG design. Mightstone won’t provide you any template. | ||
|
||
The file format allow a card JSON data to point its parent template, and assets location. Every asset paths are relative to the parent template location. Most of the time, you’ll lose the path to the assets, that’s why you need to provide ``asset_root_url`` explicitly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import asyncio | ||
|
||
from mightstone.services.cardconjurer import CardConjurer | ||
|
||
cc = CardConjurer() | ||
|
||
|
||
async def run(): | ||
card = await cc.card("my_card.json") | ||
# You might need to define the remote server if the card was | ||
# remotely built and no asset are present locally | ||
card.asset_root_url = "https://card-conjurer-assets.s3.us-east-1.amazonaws.com" | ||
await cc.render(card, "my_card.png") | ||
|
||
|
||
asyncio.run(run()) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.