- Home /
2d tool required for simple sprites?
My project will be a 2d hex turn-based strategy game. Units will be simple .png sprites (not animated) that will move from one hex tile to an other.
My first question is, do I need any 2d tool (like 2d toolkit or ex2d) to achieve this or I can do it with the tools that Unity offers? Do you suggest to use iTween for the movement?
Do you have any suggestions of how to put my .png files on the tiles of the the hex board dynamically with code? Can I have, for example, a link to the .png file in my Unit class and then assign it to a generic prefab and then put that prefab in the board?
Thanks for your time and suggestions
Answer by Alismuffin · Jan 21, 2012 at 04:35 PM
You can place a 2D camera in your scene (Simply switch perspective to orthographic in camera settings) then place the 2D Sprite on a plane or cube. Change the cube material settings to Transparent>Cutout>Diffuse. This will mean only the texture will be visible, not the rest of the mesh. To make the sprite clearer than it is when imported you can click on it in the project tab and change the import settings. Change the filter mode to "Point". This will give a crisp image. To use code to assign textures to the tiles you could create a texture variable in your code and have a look at how to change the materials texture to the one you want. Or alternatively use code to adjust offset values and have a sprite sheet. To move the sprites you could simply use transform.translate.
Thank you, kind sir, for your response. Cube looks very interesting for a base for the bitmap. I pressume that with the cube will be also easier later, when I'll try to find a way to select the unit to move it. As for the plane, correct me if I'm wrong, but cube is better, because it has less polygons?
I prefer to use cubes simply because it's easier to detect collisions with imo. Good luck with your game!
Your answer
Follow this Question
Related Questions
Tilemap with irregular sprites? 0 Answers
Bounds.extent relation to localScale 2D 0 Answers
2D Character getting a weapon. Changing it's sprites/animations 0 Answers
2d Spaceship editor? 0 Answers
In-Game 2D Sprite Building System 0 Answers