This commit is contained in:
2023-07-08 19:10:59 -07:00
parent a844c93eca
commit 83f5d99c65
4 changed files with 8 additions and 7 deletions

View File

@ -20,8 +20,7 @@
alignX="UI_COMPONENT_ALIGN_MIDDLE" alignX="UI_COMPONENT_ALIGN_MIDDLE"
alignY="UI_COMPONENT_ALIGN_MIDDLE" alignY="UI_COMPONENT_ALIGN_MIDDLE"
ref="uiLabel" ref="uiLabel"
> />
</UIRichTextLabel>
</child> </child>
<VNTextboxScroller ref="textboxScroller" label="uiLabel" visibleLines="6" /> <VNTextboxScroller ref="textboxScroller" label="uiLabel" visibleLines="6" />

View File

@ -144,8 +144,6 @@
<text> <text>
<string lang="en">I exhale. The town is stirring awake.</string> <string lang="en">I exhale. The town is stirring awake.</string>
</text> </text>
<marker name="test" />
<text> <text>
<string lang="en">I get dressed.</string> <string lang="en">I get dressed.</string>
@ -160,6 +158,8 @@
<string lang="en">A pink tulle, a kind of prettier dress.</string> <string lang="en">A pink tulle, a kind of prettier dress.</string>
</choice> </choice>
</choices> </choices>
<marker name="test" />
<text> <text>
<string lang="en">On the morning of May 29th, my mother is proud of me. She had been Angelwood's Queen in her eighteens. I am carrying her legacy on my shoulders, and today she finally believes I will be victorious.</string> <string lang="en">On the morning of May 29th, my mother is proud of me. She had been Angelwood's Queen in her eighteens. I am carrying her legacy on my shoulders, and today she finally believes I will be victorious.</string>

View File

@ -29,7 +29,7 @@ void VNTextboxScroller::onStart() {
x(); x();
useEvent(x, this->label->eventTextChanged); useEvent(x, this->label->eventTextChanged);
// useEffect(x, visibleLines); useEffect(x, visibleLines);
useEvent([&](float_t delta){ useEvent([&](float_t delta){
auto game = this->getGame(); auto game = this->getGame();

View File

@ -108,6 +108,8 @@ void UILabel::rebufferQuads(const std::vector<struct UILabelText> newTexts) {
quadCountTotal = 0; quadCountTotal = 0;
std::vector<struct UILabelText> realNewTexts; std::vector<struct UILabelText> realNewTexts;
float_t maxWidth = this->width;
// Reset // Reset
lines.clear(); lines.clear();
@ -236,8 +238,8 @@ void UILabel::rebufferQuads(const std::vector<struct UILabelText> newTexts) {
if( if(
ch != ' ' && ch != ' ' &&
lastSpaceCharacter != -1 && lastSpaceCharacter != -1 &&
this->width > charInfo.bitmapSize.x && maxWidth > charInfo.bitmapSize.x &&
(position.x + charInfo.advanceX) > this->width (position.x + charInfo.advanceX) > maxWidth
) { ) {
// Basically this rewinds everything we've done to the last space char, // Basically this rewinds everything we've done to the last space char,
// changes it to a newline, and then moves the position along. // changes it to a newline, and then moves the position along.