Your own card art
Any card item can look like your server's own card: a city ID, a company badge, a gym membership, a bank's card.
1. Make the image
- A PNG of the card's front. Any size: it is stretched to the card. A card is 1024 x 646 (about 85.6 x 54 mm), so an image of that shape looks right.
- Leave room where the holder's photo and details should go, or design the card without them.
2. Put it in cards/
Save it in ryan-wallet/cards/, for example ryan-wallet/cards/id_card.png.
3. Point the item at it
In config.lua, give the card's line in Config.Cards an art, and say where the photo and text go. All positions are
in pixels on a 1024 x 646 card, from the top left.
id_card = {
label = 'ID card', art = 'cards/id_card.png',
photo = { x = 40, y = 150, w = 260, h = 330, r = 8 }, -- false = no photo
text = {
{ 'fullname', x = 340, y = 250, size = 40, bold = true, upper = true, max = 620 },
{ 'dob', x = 340, y = 300, size = 28 },
{ 'number', x = 340, y = 350, size = 30, color = '#b8202a' },
},
},
photo: x, y (top left corner), w, h (size) and r (corner radius). false = no photo.
text: one line per detail. The first value is the field, then:
| Option | What it does |
|---|---|
x, y |
Where the text starts. |
size |
The font size in pixels. |
color |
A CSS colour, e.g. '#b8202a'. |
bold |
true = bold. |
upper |
true = capital letters. |
max |
The widest the text may be. Longer text shrinks to fit. |
No text at all = the image alone, with nothing written on it.
Fields you can write: firstname, lastname, fullname, signature, dob, sex, height, weight, eyes,
hair, number, issued, expires, class, issuer, nationality, state, title, holder, bank.
4. Restart
restart ryan-wallet.
What players see
- Everyone sees your image on that card's prop, in anyone's wallet or hand.
- The holder sees it with their details and photo written on it, on the card in their own hand.
- Someone a card is shown to sees it with the card's details in the card viewer.
Limits
- Up to 12 card items can have their own art. The 13th and later show their design instead, and the console says so
on start (
only 12 cards can have their own art). The 12 are taken in item-name order. - Changing an image needs a restart of the resource. Players who still see the old image: have them reconnect.