1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00

WIP: continue text for right reading

This commit is contained in:
Mathieu Schroeter 2019-01-29 23:41:54 +01:00
parent 4467559165
commit baa3b7141b
2 changed files with 17 additions and 9 deletions

View File

@ -2595,6 +2595,8 @@ CEvent::DrawButtons ()
else
pente = 19;
pos.x += LXOFFSET ();
if (IsRightReading ())
pos.x = LXIMAGE () - pos.x;
DrawTextRect (m_pPixmap, pos, m_libelle, pente, FONTSLIM);
}
@ -3034,9 +3036,9 @@ CEvent::EventButtons (const SDL_Event & event, Point pos)
{
snprintf (m_textToolTips, sizeof (m_textToolTips), "%s", text);
lg = GetTextWidth (m_textToolTips);
pos.x += IsRightReading () ? -lg : 10;
pos.x += IsRightReading () ? -10 : 10;
pos.y += 20;
if (pos.x > LXIMAGE () - lg)
if (pos.x > LXIMAGE () + (IsRightReading () ? 0 : - lg))
pos.x = LXIMAGE () - lg;
if (pos.x < 0)
pos.x = 0;

View File

@ -195,11 +195,20 @@ DrawText (CPixmap * pPixmap, Point pos, const char * pText, Sint32 font)
else
pPixmap->DrawIcon (-1, CHLITTLE, rank, pos);
pos.x += GetCharWidth (pText, font);
if (inc)
if (IsRightReading ())
{
if (inc)
pText++;
pText++;
pText++;
pos.x += -GetCharWidth (pText, font);
}
else
{
pos.x += GetCharWidth (pText, font);
if (inc)
pText++;
pText++;
}
}
}
@ -211,9 +220,6 @@ DrawTextPente (
{
Sint32 rank, lg, rel, start;
if (IsRightReading ())
pos.x = LXIMAGE () - pos.x;
start = pos.y;
rel = 0;
while (*pText != 0)