[messages] [Module Design] Can you assign a layer to a deck?

Sebaestschjin sebastian.naehring at gmail.com
Tue Apr 22 13:20:28 CEST 2014


Well maybe you can use a little workaround trick. Add the label with the
number as a trait to the cards in the deck. Just be sure that is after
the mask trait. Set the text of the label to some property lile
$DeckNumber$. Then add a calculated property to the cards with an
expression like:

Code:

If($DeckName$ == <Name of the card deck>, GetProperty(<Name of the card
deck> + "_numPieces"), "")



If you replace the two values in <> with the name of your deck the top
card of the deck will show the number of cards in the deck. When the
card is not in the deck it will show nothing, otherwise it would look
awkward.
When you use a property for the name of the deck you can even reuse this
approach for other decks:

Code:

If($DeckName$ == $ValidDeck$, GetProperty($ValidDeck$ + "_numPieces"),
"")



Simply add a marker "ValidDeck" to each deck to specify which deck this
card should count.
However if one card can be part of different decks for which you want to
count, this needs some further thought to allow such things.

_______________________________________________
Read this topic online here:
http://www.vassalengine.org/forum/viewtopic.php?p=44598#p44598


More information about the messages mailing list