git repos / saland

commit 548f0902

sago007 · 2018-09-07 18:40
548f0902fda4d010bec5771320800b6a48eceb12 patch · browse files
parent 07f722b1d3ffce0cc8fb5a049acf53f1f9947356

Print the tile coordinate in the lower part of the screen

Changed files

M src/saland/Game.cpp before
diff --git a/src/saland/Game.cpp b/src/saland/Game.cpp index 1f7998d..f25bb87 100644 --- a/src/saland/Game.cpp +++ b/src/saland/Game.cpp
@@ -291,7 +291,9 @@ void Game::Draw(SDL_Renderer* target) {
DrawProjectile(target, globalData.spriteHolder.get(), projectile, SDL_GetTicks(), data->topx, data->topy, true);
}
}
- data->bottomField.SetText("This is in the lower part of the screen");
+ char buffer[200];
+ snprintf(buffer, sizeof(buffer), "world_x = %d, world_y = %d", data->world_mouse_x/32, data->world_mouse_y/32);
+ data->bottomField.SetText(buffer);
data->bottomField.Draw(target, 2, 768, sago::SagoTextField::Alignment::left, sago::SagoTextField::VerticalAlignment::bottom);
}