x


How to add a grid to an image?

Hello, I am using the UnityPro/iPhonePro trial version. Making a card game in 2D, I have a large image containing the 52 playing cards. I've imported it as an asset, but now I don't know how to proceed.

Is this done via script? I'm reading this, and I think it's what I want to do.

http://forum.unity3d.com/threads/3712-Bringing-2D-images-into-the-scene?p=27485&viewfull=1#post27485

Thanks!

more ▼

asked Jan 31 '11 at 01:41 PM

jcrockett gravatar image

jcrockett
5 2 2 7

just FTR - if you're an absolute beginner just grab something like 2DToolkit to do any such 2D jobs. It is absolutely simple - just drag in the PNGs. Hope it helps

Dec 07 '12 at 01:38 PM Fattie
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Sound like a job for UV mapping. You could do this with a modeller (I like Blender cuz it's free). You could do this with a script as well, see example here: http://unity3d.com/support/documentation/ScriptReference/Mesh-uv.html

more ▼

answered Jan 31 '11 at 05:27 PM

DaveA gravatar image

DaveA
26.5k 151 171 256

I'm not sure how to apply it.

Feb 01 '11 at 12:07 AM jcrockett

Well, apply what? If you generate UV's like you see in that link (with the math appropriate for your image, of course), you set that to the mesh. Ah, perhaps this: You'll want one mesh per card, and each of those meshes will use the same texture, but different uv's.

If you were doing this with a modeller like Blender or whatever, you'd make 52 different quads and the same texture, with different UV maps. Want a link to a good Blender UV tutorial?

Feb 01 '11 at 12:16 AM DaveA

Yes, please....

Feb 06 '11 at 06:21 PM jcrockett
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2203
x268

asked: Jan 31 '11 at 01:41 PM

Seen: 1126 times

Last Updated: Dec 07 '12 at 01:38 PM