• Editor
  • Making a deck of cards

This is the first time I am using spline and I am wondering whether something like this is possible with it.
Before buying it.

I am building a card game with perspective view.
I want to show cards on different part of a table.

I want deform the card so it looks like it is on a table.

I am going to create 52 skins and add each card to that so that I can switch the skin and create each card.

The problem I am having is when I deform a card will that get applied to all the skins?
I mean it is not practical to deform all 52 cards right?

I hope what I wanted to do is clear.
Can anyone provide some help on this?

Related Discussions
...

You can use linked meshes. Create a mesh for the card, then create 51 linked meshes from it. All those meshes will use the same vertices, but can have a different image. Specify a name or path for the source mesh and each linked mesh so they each use a different card image. If you are not animating the card images, you may not even need skins, just show the mesh for the card image you want.

I've never used Cocos Creator and it isn't an officially supported runtime. You may need to ask them how to use their stuff, though it looks like they are using some bastardized version of our official runtime. If so, see here:
Spine Runtimes Guide
API Reference - Spine Runtimes Guide
In our API, you can change an attachment like this:

skeleton.setAttachment("slotName", "attachmentName");
// OR:
skeleton.findSlot("slotName").setAttachment("attachmentName");
5 días más tarde

Thank you for your reply.
This code works same way in Cocos, I can set an attachment using this.

Is there a way to show / hide a slot?

I add all the cards to a slot using a linked mesh and I deform it to represent a dealer card.
I can add another slot and deform it to represent a player card.

If I can switch between these 2 slots I can use the same card to display cards in 2 positions.

I may be going about this in a wrong way.
But is there a way to do something like this?

You can hide a slot by setting its attachment to null via skeleton.findSlot("name").setAttachment("null").

For a single frame, you could simply render the skeleton twice, once for the dealer card, and once for the player card. Just set the attachment on the slot correctly before drawing either card.

Got it thanks.

I just leaned that you require WebGL to deform a image using link meshes.

Is there any other way to deform a playing card to get a perspective view that does not require WebGL?

I'm afraid there isn't. Cocos Creator can upgrade to our latest Canvas implementation, which has experimental mesh support. However, be warned that it will results in artifacts on some browser, and may be slow. The Canvas API was not meant for this kind of black magic.