Show tile value in the status bar

This commit is contained in:
David Capello 2019-08-05 08:37:58 -03:00
parent 92b794d457
commit dfaf01ced4
1 changed files with 10 additions and 0 deletions

View File

@ -599,6 +599,16 @@ bool StandbyState::onUpdateStatusBar(Editor* editor)
if (!grid.isEmpty()) {
gfx::Point pt = grid.canvasToTile(gfx::Point(spritePos));
sprintf(buf+std::strlen(buf), " :grid: %d %d", pt.x, pt.y);
// Show the tile index of this specific tile
if (site.layer() &&
site.layer()->isTilemap() &&
site.image()) {
if (site.image()->bounds().contains(pt)) {
sprintf(buf+std::strlen(buf), " [%d]",
site.image()->getPixel(pt.x, pt.y));
}
}
}
}