summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2025-03-05 13:20:18 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2025-03-07 22:27:48 +0100
commitad8a68be501d8ffef9fbfceacdc4c13b84a0d74a (patch)
tree97469f00f818ab3130e841f2b94a6a9259e13b76 /src/gui
parenta1bc8e1974d04a111127b744413094a886de4de6 (diff)
downloadmana-ad8a68be501d8ffef9fbfceacdc4c13b84a0d74a.tar.gz
mana-ad8a68be501d8ffef9fbfceacdc4c13b84a0d74a.tar.bz2
mana-ad8a68be501d8ffef9fbfceacdc4c13b84a0d74a.tar.xz
mana-ad8a68be501d8ffef9fbfceacdc4c13b84a0d74a.zip
Introduced spriteOffsetY setting to replace half tile hack
For historical reasons, sprites get a 16 pixel offset by default, which is used to position them correctly on their tile. When pixel-based movement was added, actors are now positioned on the middle of a tile and the built-in offset was removed. Servers that use sprites that do not rely on this offset can now set the spriteOffsetY option to 0.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/playerbox.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gui/widgets/playerbox.cpp b/src/gui/widgets/playerbox.cpp
index 9858727d..dff87114 100644
--- a/src/gui/widgets/playerbox.cpp
+++ b/src/gui/widgets/playerbox.cpp
@@ -82,9 +82,8 @@ void PlayerBox::draw(gcn::Graphics *graphics)
if (mBeing)
{
// Draw character
- const int bs = getFrameSize();
- const int x = getWidth() / 2 + bs;
- const int y = getHeight() - bs;
+ const int x = getWidth() / 2;
+ const int y = (getHeight() + mBeing->getHeight()) / 2 - 12;
mBeing->drawSpriteAt(static_cast<Graphics*>(graphics), x, y);
}