// Load tileset
Gosu::imagesFromTiledBitmap(graphics(), Gosu::sharedResourcePrefix() + L"data/" + Gosu::utf8ToWstring(tilesetName), _tileWidth, _tileHeight, true, _tiles);
// Drap map
int x, y;
int offsetX = (_screenWidth - _tileWidth * _mapWidth) / 2.0f;
int offsetY = _screenHeight / 2.0f;
for (int i = 0; i < _mapHeight; ++i) {
for(int j = _mapWidth - 1; j >= 0; --j) {
x = offsetX + ((j * _tileWidth / 2.0f) + (i * _tileWidth / 2.0f)) * _zoom;
y = offsetY + ((i * _tileHeight / 2.0f) - (j * _tileHeight / 2.0f)) * _zoom;
_tiles[_map[i * _mapHeight + j]]->draw(x, y, 0, _zoom, _zoom);
}
}
CptnRuby.rb
example does the same (the C++ version is available as CptnCpp
on Github).namespace Gosu {
// Call this function before creating any Image
void enableUndocumentedRetrofication() { extern bool undocumentedRetrofication; undocumentedRetrofication = true; }
}
Gosu::enableUndocumentedRetrofication();
#include <Gosu/Gosu.hpp>
but it's not in the docs either.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill