Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Theopt · Dec 27, 2013 at 10:53 PM · textgameimagecardover

Some questions regarding card game

Greetings, I'm trying to make a small card game and I have some questions:

1) I've made a prefab of a blank card, and I want to fill it with text for several cards, whats the best approach? Creating every card png? Or having a script attached to the card that changes every attribute I wanted? and If so, how would I write the text over image?

2) Whats the best approach to make a card db?

Thanks in advance

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by GoCatGoGamesLLC · Dec 28, 2013 at 03:28 PM

Greetings back atcha!

Ask ten programmers/designers/people for the "best approach" will likely get you eleven answers. Here are mine!

I like relational databases. Your "card" will likely be made up of several elements (correct me if I'm wrong, please), like a Title/Name, an image or bacground, some text, maybe even some integral variables that show current health or attack or something. All of these can be tracked many ways, but I would suggest a database that will allow you to get all of these parts and apply them to the default prefab instance of a card in Unity.

Prefab is basically "Blank" and, at instantiation, gets its attributes applied via the database ID/primary key.

This, by my reckoning, will give you the best way to simulate finite decks and random draws.

Comment
Add comment · Show 7 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Theopt · Dec 28, 2013 at 03:40 PM 0
Share

for the prefabs database, should I use C#+Sqlite? or is there a better way?

avatar image mescalin · Dec 28, 2013 at 03:42 PM 0
Share

unfortunately i am not sure there is a database in unity, please correct me if i am wrong i tend to create objects and hardcode a lot of data

avatar image Theopt · Dec 28, 2013 at 03:53 PM 0
Share

yeah I've found a way of using mysql, didnt tested it though. Without a database, creating an instance of several cards and filling the attributes for each one might also work and maybe would be faster for now :x

avatar image GoCatGoGamesLLC · Dec 28, 2013 at 04:05 PM 0
Share

There are a few implementations on the Asset Store for SQLite -- not sure if you want to lay out ca$h, though. X$$anonymous$$L files can do the trick and offer some post-build customization. You'll need to add using System.Xml and using System.IO to your script to access the X$$anonymous$$L features of C#.

avatar image Theopt · Dec 28, 2013 at 04:16 PM 0
Share

Can I use the X$$anonymous$$L/Json coding through javascript and ajax like I usually do in my javascripting on php?

Show more comments
avatar image
0

Answer by Owen-Reynolds · Dec 28, 2013 at 03:17 PM

The standard 3DText gameObject (in code called a TextMesh) does a nice job of putting text on something in the game world. Can display arbitrary strings, but no internal format changes (like bolding one word.) Lots of questions/answers about it here (like see-through-ness and multiple lines.)

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How can I get game data from a specified file? 0 Answers

Trading Card Game 5 Answers

How to Place and arrange 3D cards using Grid and Bounds 0 Answers

Card Game like yu-gi-oh 1 Answer

Print char to a 2D image? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges