Каждая плитка имеет «текстуру» (0: сетка, 1: трава и т. Д.)
Код: Выделить всё
maps[currentMapID].getLayerArray()[l].getTileArray()[t].setTexture(currentSelectedTexture);
Код: Выделить всё
void tile::setTexture(int t)
{
numTexture = t;
}
< /code>
Этот код полностью работает при создании тестовой плитки. < /p>
Структура моего кода (классы): < /p>
Map > layer > tile. => all of them in a class which handle graphics.
Код: Выделить всё
std::vector layer::getTileArray()
{
return tiles;
}
Я также проверил CurrentselectedTexture , и там нет проблем.
Подробнее здесь: https://stackoverflow.com/questions/337 ... -the-value
Мобильная версия