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:
parent
4467559165
commit
baa3b7141b
@ -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;
|
||||
|
20
src/text.cxx
20
src/text.cxx
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user