eugene.litvinov Posted January 14, 2011 Posted January 14, 2011 I have next ui-file: <?xml version="1.0" encoding="utf-8"?> <ui version="1.0"> <!-- Определяет диалог с пользователем --> <vbox name="Source::TextPanel::mainPanel" export="1"> <sprite align="background" texture="source/textures/game/gui/text_panel.png"/> <vbox align="overlap,expand" space="8"> <label align="expand" name="Source::TextPanel::captionLabel" export="1"> <text rich="1"> <p align="center">Paragraph</p> <p align="left">This is a main text, it's descibe some game situatuin</p> </text> </label> <hspacer align="expand"/> <hbox> <icon name="Source::TextPanel::prevPageButton" export="1" width="42" height="42" texture="source/textures/game/gui/item_rose.png"> <callback type="clicked">Source::TextPanel::eventPrevButtonClick</callback> </icon> <vbox> </vbox> <icon name="Source::TextPanel::nextPageButton" export="1" texture="source/textures/game/gui/item_whistle.png"> <callback type="clicked">Source::TextPanel::eventNextButtonClick</callback> </icon> </hbox> </vbox> </vbox> </ui> This is looks good, but text in label output in one line and go out from my panel. Then I use next code line to fix this: captionLabel.setFontWrap(true); Then text place in all size of my panel, but in few moments it reduse his width: I check my update methods - they do not address to widget elements and do not change their properties.
eugene.litvinov Posted January 16, 2011 Author Posted January 16, 2011 Added test project with described situation test_input.zip
frustum Posted January 16, 2011 Posted January 16, 2011 You should set width of vbox container. In your example vbox don't know about size of text_panel sprite. And because of this vbox shrinks to minimal text size. <vbox align="overlap" space="8" width="320">
Recommended Posts