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
|
else
|
||||||
pente = 19;
|
pente = 19;
|
||||||
pos.x += LXOFFSET ();
|
pos.x += LXOFFSET ();
|
||||||
|
if (IsRightReading ())
|
||||||
|
pos.x = LXIMAGE () - pos.x;
|
||||||
DrawTextRect (m_pPixmap, pos, m_libelle, pente, FONTSLIM);
|
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);
|
snprintf (m_textToolTips, sizeof (m_textToolTips), "%s", text);
|
||||||
lg = GetTextWidth (m_textToolTips);
|
lg = GetTextWidth (m_textToolTips);
|
||||||
pos.x += IsRightReading () ? -lg : 10;
|
pos.x += IsRightReading () ? -10 : 10;
|
||||||
pos.y += 20;
|
pos.y += 20;
|
||||||
if (pos.x > LXIMAGE () - lg)
|
if (pos.x > LXIMAGE () + (IsRightReading () ? 0 : - lg))
|
||||||
pos.x = LXIMAGE () - lg;
|
pos.x = LXIMAGE () - lg;
|
||||||
if (pos.x < 0)
|
if (pos.x < 0)
|
||||||
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
|
else
|
||||||
pPixmap->DrawIcon (-1, CHLITTLE, rank, pos);
|
pPixmap->DrawIcon (-1, CHLITTLE, rank, pos);
|
||||||
|
|
||||||
pos.x += GetCharWidth (pText, font);
|
if (IsRightReading ())
|
||||||
|
{
|
||||||
if (inc)
|
if (inc)
|
||||||
|
pText++;
|
||||||
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;
|
Sint32 rank, lg, rel, start;
|
||||||
|
|
||||||
if (IsRightReading ())
|
|
||||||
pos.x = LXIMAGE () - pos.x;
|
|
||||||
|
|
||||||
start = pos.y;
|
start = pos.y;
|
||||||
rel = 0;
|
rel = 0;
|
||||||
while (*pText != 0)
|
while (*pText != 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user