Generic UI for card games like Hearthstone, Magic Arena and Slay the Spire, etc
Here are some images that illustrate what the repository contains and a decription of the content.
For a playable version access itch.io page.
Draw Card | Hover Card |
---|---|
Play Card | Angle Positioning |
Card Spacing | Hover Enemy Card |
The repository has the main elements of an user interface for a card game like Magic Arena, Hearthstone, Slay the Spire etc. It's made in Unity3D and might be a good "starting point" for games such as the mentioned titles.
Currently, you can:
- Draw cards
- Drag cards
- Put cards back in the hand dropping onto the "Hand Zone" (green area);
- Play/Discard cards dropping onto the "Play Card Zone" (orange area);
- Hover/zoom in cards on the player's hand;
- Check cards from the enemy's hand
- As an additional content, I've added to the demo parameters to configure the layout the way you game designer want. It can be done by enabling the checkbox named "configs", on the top-left side of the screen.
The following parameters can be changed:
- Card spacing;
- Card rotation angle;
- Card height (position on Y-axis) relative to the bent angle on item 2;
- Card hovered size: how much a card shrinks or grows when hovered;
- Card hovered rotation: whether it changes or not;
- Card hovered height: how much a card moves up (Y-axis) when hovered;
- Card hovered speed: moving speed of the card when hovered;
- Position or pivot of the Hand: move it up and down;
- Drop Zone's positions: move them up and down;
- Disabled card Transparency (alpha): how much a disabled card "fades".
- Motion speed: scale, movement and rotation.
Limitations:
- The interface is using 2D colliders, that way, the objects are not fully compatible with a 3D game;
- Memory heavy, each card has a state machine with a few states inside, in a limited environment, or overtime it is definitely a issue;
- ...
Thank you, any feedback is appreciated.
Illustations by: Tyler Warren https://tylerjwarren.itch.io/free-tyler-warren-rpg-battlers-favorites-30
---------------------- MIT License ----------------------
Copyright 2019 Ycarowr
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.