I want the number of cards in a deck to show on top of the deck.
If I place a piece with the text property ($deck _numPieces$) without a layer value, it works… until I draw a card and then click the “undo” button, in which case the number disappears.
I tried to set the highest Layer for the text piece and then attach a Marker → Layer to each card, to make sure that they are at a lower level, but when I do it, the number fails to show at all. I assume it is because the deck is at a default (none) level, putting it above the text piece.
Any ideas how to solve this?
Placing a piece and a deck in the same location will cause problems so I don’t think you’ll get this to work. However, you can place a piece right next to, or above / below, a deck to display the number of card in the deck.
Thanks! That’s what I had, but space is at at premium. If I could get it to show on the deck, I would, so I thought I would ask.
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:
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:
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.