- Home /
2d graphics
Hi, I'm creating a 2d game and I was originally making my levels and objects out of 3d objects made from blender. Is there an easier way to make 2d graphics and put them in your game instead of hassling with 3d objects?
Answer by Anxo · Aug 18, 2011 at 05:38 PM
Hi Jake,
Well Unity is a 3D Engin and all your your objects will always be 3D and in 3D space. But, you can put all your graphics on planes, they are still 3D Objects as they can be rotated in XY and Z but they only have 2 triangles, which minimizes the amount of mesh you have and gives you a 2D Effects.
Note that the planes from the engine have a lot of triangles, if you are planing on using this method, it is a good idea to import a Mesh plane from a 3rd party software like 3ds max or blender with only 1 polygon or 4 vertexes or 2 triangles =) to Unity and apply your textures to it.
I was told that it is best to scale it in the 3rd party software or in the import settings instead of using the In game scale tool. It is one of these things that I have been told, and I dont know why its done but I do it lol.
I scale in 3rd party as well, I remember knowing the reason somewhere (something to do with performance, obviously). What do yhou mean wiht this line "with only 1 polygon or 4 vertexes or 2 triangles" I usually use a 2d image editor and use that as my texture
"with only 1 polygon or 4 vertexes or 2 triangles" What I meant by that was when you make a plane in a 3D application, you should not teselate it or mesh smooth it. It should only have 2 faces which is equal to 1 polygon with 4 vertexes and would have 2 triangles. The unity provided plane has many triangles.
I'm still a little confused. So I made this cactus in photoshop, all it is is a cactus with a transparent background. How would I make it so that 2d cactus is my game. I tried to put it on a plane but for some reason it did not display the whole cactus texture, only a zoomed in part of it. Then I tried putting it on a cube, but I still get the white background of the cube. What am I doing wrong?
Answer by cfbevan · Aug 18, 2011 at 09:00 PM
Draw texture is your best bet.
http://unity3d.com/support/documentation/ScriptReference/Graphics.DrawTexture.html
Also this may be of interest to you: http://www.youtube.com/watch?v=HXREh5hacV0
Answer by Auzette · Aug 20, 2011 at 01:11 AM
Nod. If it's absolutely 2D only, there's no reason you couldn't bypass the 3D entirely and just use GUI.DrawTexture() calls...
Seems like a lot of extra power doing nothing, though. If you do a 2D game as 3D planes with textures on them, you can do some cool effects and particles that you couldn't easily replicate in the 2D GUI layer.
Your answer
Follow this Question
Related Questions
Importing animations and objects from Blender to Unity. 2 Answers
Small line appearing under my 2D pixel sprite - 2D Graphics not rendering properly 2 Answers
Draw only what is seen in camera 2D? 1 Answer
How can I unfocus and fade my background in a 2D game? 0 Answers
How to create an object from 3D points in a text file?! 2 Answers