Author Topic: Making a card game with NGUI.  (Read 2320 times)

vidjogamer

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 48
    • View Profile
Making a card game with NGUI.
« on: April 08, 2014, 09:49:23 AM »
Hello, I'm working on card game with NGUI. Its something like Magic the Gathering where each card has its own powers and what not. I wanted to get some ideas for good ways to go about this with NGUI. I'd like to start out doing things in a smart modular fashion. Let me know if you have any suggestions how to go about it. Thanks!

zazery

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 26
    • View Profile
Re: Making a card game with NGUI.
« Reply #1 on: April 08, 2014, 03:13:05 PM »
I've done this for a contract job and my own project. There is nothing special you need to know when working with NGUI. For each card type build a prefab consisting of a group of sprites and labels. Try to avoid overdraw as much as possible. I load the data from a CSV file and build a model (MVC). The script on the card prefab takes the model representation and hides/tints/changes the sprites and labels. Using UIGrid and a ScrollView is a quick way to handle prototyping a hand of cards.

One thing you will need to worry about is overlapping cards in the same panel. Since the cards are made out of multiple widgets their depths will intersect with each other. You will need to manage the depths manually.

vidjogamer

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 48
    • View Profile
Re: Making a card game with NGUI.
« Reply #2 on: April 09, 2014, 07:20:49 AM »
Awesome, thank you very much. This is the same approach is was thinking :D