Generate different types of cards using the same ruby file #357
-
In my card game, I have multiple types of cards with a totally different layout. I could generate these using new Ruby files, but then these cards would not be generated on the same PDF. Is there a way to generate different types of cards from the same file? If all cards come from the same .csv file, then defining the number of cards that need to be generated with Squib::Deck.new cards: data['ID'].size becomes hard. I could also use different .csv files for each new card type, but no idea how to use multiple data files in one Ruby file. Any possibility of generating different types of cards from the same file? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Is stitching them all into one PDF the only reason to do them in one deck? If so, you can do something like this:
So essentially the output of one Squib run becomes the input to another. I did something like this here: https://github.com/andymeneely/project-bolt-rats/blob/master/lib/pnp.rb My rule of thumb is one deck per "sheet" in Excel. If I have everything in one sheet with most of the columns filled out, that's one deck. If I have two sheets with different columns, that's two decks. If you really want everything in a single deck, then your best bet is to use |
Beta Was this translation helpful? Give feedback.
Is stitching them all into one PDF the only reason to do them in one deck? If so, you can do something like this:
attack.rb
anddefend.rb
separately, they output to things like_output/char_attack_00.png
and_output/char_defend_00.png
pnp.rb
Dir['_output/char_*.png']
to get all of those files at once.png
command.So essentially the output of one Squib run becomes the input to another. I did something like this here: ht…