D
D
Danil Chekalin2017-05-23 00:37:03
Game development
Danil Chekalin, 2017-05-23 00:37:03

Sprite Atlas: how to upload, mappit?

Complex question. And so, there is a png'shka on which a bunch of tiles 30x30. I cut it all with the Sprite Editor and got an atlas (am I calling the entity correctly?):
2f5ZV.jpg
Next, I would like to somehow map each element of the atlas to constants:

public class TileMap
{
    public const string GROUND_DESERT = "desert";
    public const string GROUND_GREEN_GRASS = "green_grass";
    public const string GROUND_SANDY_LOAM = "sandy_loam";


    // Common roads
    public const byte NEW_VERT_ROAD = 1;
    public const byte NEW_HORZ_ROAD = 2;
    public const byte BRK_VERT_ROAD = 3;
    public const byte BRK_HORZ_ROAD = 4;
    public const byte RSD_HORZ_ROAD = 6;
    public const byte CROSS_ROAD    = 8;

    // Rotated roads
    public const byte RTT_BOTTOM_RIGHT_ROAD = 10;
    public const byte RTT_BOTTOM_LEFT_ROAD = 11;
    public const byte RTT_TOP_LEFT_ROAD = 12;
    public const byte RTT_TOP_RIGHT_ROAD = 13;

    // Decor
    public const byte GREENERY_BUSH = 15;
    public const byte GREENERY_TREE_1 = 16;
    public const byte GREENERY_TREE_2 = 17;
    public const byte GREENERY_TREE_3 = 18;

    // ......
}

In order to send me CSV with these values, after them I rendered these sprites.
Total: how to load the atlas, then use it, having previously mapped it to constants?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alibek Beldinov, 2017-05-24
@dakiesse

First you need a tile map editor. You can use this one . And then collect the scene from a text file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question