sfml text align for multiline text
Opened this issue · 1 comments
Laguna1989 commented
Multiline text defintion:
jt::Text
- contains at least one "\n"
This behaves differently for SFML (code) and SDL (code) builds due to differences between the implementations. SFML considers the full text box, while SDL considers each line (which results in the proper result)
Possible solution
- Change the SFML implementation class to contain a vector of
sf::Text
objects instead of only one. Onesf::Text
per line. - Text needs to be split on linebreaks.
- Make the
doUpdate()
function set the position of the individualsf::Text
objects depending on the width of the longest line and them_textAlign
value. - Make the
doDraw()
functions (including flash and shadwo) draw those multiplesf::Text
objects.
Please check
- Adapt the Scroll/MoveCam demo to contain multiline text with different alignments
- Check that all unit tests pass
- Check that new code branches are tested. This might require some additions to the text_test and potentially the drawable_impl_test
- Check/Adapt the state_menu if needed.
Laguna1989 commented
textalign right is already fixed. Mulitline text not yet fully supported.