Nand Blog

Games, software and BGG...
Recommend
32 
 Thumb up
12.25
 tip
 Hide

nanDECK, a tutorial for starters

Andrea Nand
Italy
Modena
flag msg tools
Best. Game. Ever.
badge
I wrote nanDECK and BGG1tool
Avatar
Microbadge: nanDECK userMicrobadge: TARDISMicrobadge: The Lord of the Rings fanMicrobadge: xkcd fanMicrobadge: ILSA Magazine fan
Following a specific request (Re: Searching for advices...) this is a simple yet complete tutorial about how to create a deck of cards starting from a spreadsheet file.

First, I wrote some data, and saved them as Data.xls:

From gallery of n_and


Note: each column will be identified with the name in the first line (each must be different).

I start nanDECK, and as first line I link that file:

LINK = Data.xls

Then I saved the script, as Tut01.txt, in the same folder with the Excel file (if I want to save it in a different folder, in the LINK line I must specify also the path, for example c:\users\nand\desktop\data\data.xls)

I want to put the title in the top of the card, then I select a font with the line:

FONT = Arial, 24, , #000000

Font name for the 1st parameter, size for the 2nd, and color for the 4th. The 3rd is empty, this is the place for flags like B (bold), I (italic), U (underline) and so on (among others, if you want to shrink the font size to fit the space, use a N flag, if you doesn't want to see the text background, use a T flag).

And add the title with this line:

TEXT = 1-3, [name], 0, 0, 100%, 20%

The 1st parameter is the range, and I want to put this text on three cards (from 1 to 3, then the syntax is 1-3), the 2nd parameter is the column name from the Excel file (enclosed in square brackets), the others are the position (0, 0 is top left), width (100% of the card's width) and height (20% is a fifth of the card's height).

Note: I can use also values in cm, and I can specify 0, 0, 6, 1.8 (for a default card of 6 x 9 cm), but with percentual values I can change the size of the card without having to change every size of every element.

With a clic on "Validate deck" button, "Build deck" button, the deck is created with three (ugly) cards:

From gallery of n_and
From gallery of n_and
From gallery of n_and


Let's add some images:

IMAGE = 1-3, [img], 0, 20%, 100%, 40%, 0, P

The 0 in the 7th parameter is the angle of rotation for the image, and the P is for proportionally resize the image, if you have transparent PNGs, add a N flag in the same parameter (i.e. PN).

I've added the images' files in the same folder with the spreadsheet and the script, and this is the result after Validate + Build:

From gallery of n_and
From gallery of n_and
From gallery of n_and


These lines are for the description:

FONT = Arial, 10, , #000000
TEXT = 1-3, [desc], 5%, 65%, 90%, 30%, left, wordwrap


I choose a smaller font, and since the description is more than one line, I add left as horizontal alignment and wordwrap as vertical. This is the result:

From gallery of n_and
From gallery of n_and
From gallery of n_and


These lines are for the value column:

FONT = Arial, 32, T, #FF0000
TEXT = 1-3, [value], 0, 20%, 20%, 40%


To make the number readable on every background, I can add an outlined text:

FONT = Arial, 32, T, #FFFFFF
TEXT = 1-3, [value], 0, 20%, 20%, 40%, center, center, 0, 100, 0.1


The "0, 100, 0.1" are respectively for angle, transparency and outline width.

Note that these lines must be added before, because every element in a script is drawn accordingly to its position: first are drawn elements in the first lines, the last drawn are those in the bottom lines.

From gallery of n_and
From gallery of n_and
From gallery of n_and


I have four icons (one for each element), each identified with a letter in my Excel file (and on each card there may be more than one icon). I add these lines in the script:

ICON = 1-3, A, air.png
ICON = 1-3, E, earth.png
ICON = 1-3, F, fire.png
ICON = 1-3, W, water.png

ICONS = 1-3, [icons], 80%, 20%, 20%, 40%, 20%, 10%, 0, PN


In the last line I specify the icons' area (80%, 20%, 20%, 40%), the size of each icon (20%, 10%), the angle of rotation (0) and to use PNG transparency (N) and proportional resize (P).

I've added the four png files in the same folder. And this is the result:

From gallery of n_and
From gallery of n_and
From gallery of n_and


Finally, I want to duplicate each card for the number specified in the "num" column, then I add, as first line (before the LINK), this directive:

LINKMULTI = num

I must also change every range 1-3 into 1-7. This is the result page:

From gallery of n_and


This is a more compact version of the script, here the 1st parameter (the range) is empty for most directives because I want to put the text/images on all the cards, and if I leave the 1st parameter empty, nanDECK uses as a default 1-x, where x is the number of lines in the Excel file.

LINKMULTI = num
LINK = Data.xls

FONT = Arial, 24, , #000000
TEXT = , [name], 0, 0, 100%, 20%

IMAGE = , [img], 0, 20%, 100%, 40%, 0, P

FONT = Arial, 10, , #000000
TEXT = , [desc], 5%, 65%, 90%, 30%, left, wordwrap

FONT = Arial, 32, T, #FFFFFF
TEXT = , [value], 0, 20%, 20%, 40%, center, center, 0, 100, 0.1
FONT = Arial, 32, T, #FF0000
TEXT = , [value], 0, 20%, 20%, 40%

ICON = , A, air.png
ICON = , E, earth.png
ICON = , F, fire.png
ICON = , W, water.png

ICONS = , [icons], 80%, 20%, 20%, 40%, 20%, 10%, 0, PN


And if you have some questions, feel free to ask.
Twitter Facebook
51 Comments
Subscribe sub options Wed Apr 22, 2015 6:19 pm
Post Rolls
  • [+] Dice rolls
Loading... | Locked Hide Show Unlock Lock Comment     View Previous {{limitCount(numprevitems_calculated,commentParams.showcount)}} 1 « Pg. {{commentParams.pageid}} » {{data.config.endpage}}
{{error.message}}
{{comment.error.message}}
    View More Comments {{limitCount(numnextitems_calculated,commentParams.showcount)}} / {{numnextitems_calculated}} 1 « Pg. {{commentParams.pageid}} » {{data.config.endpage}}

Subscribe

Contributors