I made some changes in my CE-Code to provide horizontal text alignment in Listboxes. It works perfectly for me.
@CE: maybe you want to merge this into your project
The changes:
In CEGUIListboxTextItem.h I added this public members to ListboxTextItem class:
Code: Select all
enum HorzFormatting
{
LeftAligned,
RightAligned,
HorzCentred,
WordWrapLeftAligned,
WordWrapRightAligned,
WordWrapCentred,
};
HorzFormatting d_horzFormatting;
void setHorizontalFormatting(HorzFormatting h_fmt) { d_horzFormatting = h_fmt; }
I added the parameters z and absarea to the draw member of ListboxItem and ListboxTextItem:
Code: Select all
virtual void draw(const Vector3& position, float alpha, const Rect& clipper, const Rect& absarea, float z) const;
and made some changes in CEGUIListboxTextItem.cpp, in the function draw:
Code: Select all
if (fnt != NULL)
{
Rect area = absarea;
area.setPosition(Point(position.d_x, position.d_y));
fnt->drawText(d_itemText, area, z - 0.001, clipper, (CEGUI::TextFormatting)d_horzFormatting, getModulateAlphaColourRect(d_textCols, alpha));
}
That's all
Greetings,
Emmeran