Testing mixing styles

This commit is contained in:
2023-06-17 08:29:29 -07:00
parent f766f675ce
commit 77f5383cb9
3 changed files with 11 additions and 12 deletions

View File

@ -15,18 +15,18 @@
<child>
<UIRichTextLabel
alignment="0, 0, 0, 0"
alignX="UI_COMPONENT_ALIGN_STRETCH"
alignY="UI_COMPONENT_ALIGN_STRETCH"
alignment="0, 0, 65, 192"
alignUnitLeft="UI_COMPONENT_ALIGN_UNIT_PERCENT"
alignUnitRight="UI_COMPONENT_ALIGN_UNIT_PERCENT"
alignX="UI_COMPONENT_ALIGN_MIDDLE"
alignY="UI_COMPONENT_ALIGN_MIDDLE"
ref="uiLabel"
>
<font font="font_arial" size="32">
Hello World
How are you today?
How <font color="RED">are</font> you today?
I'm doing great, thanks!
Thanks, me too!
</font>
<font font="font_arial" size="36" color="RED">
Glad to hear it!
I'm glad to hear it too!
What a great day!
@ -40,5 +40,5 @@
</UIRichTextLabel>
</child>
<VNTextboxScroller ref="textboxScroller" label="uiLabel" />
<VNTextboxScroller ref="textboxScroller" label="uiLabel" visibleLines="6" />
</prefab>

View File

@ -25,9 +25,10 @@ void VNTextboxScroller::onStart() {
this->label->quadCount = 0;
this->readyToClose = false;
};
x();
useEvent(x, this->label->eventTextChanged);
useEffect(x, visibleLines)();
useEffect(x, visibleLines);
useEvent([&](float_t delta){
auto game = this->getGame();

View File

@ -16,13 +16,11 @@ UIBorder::UIBorder(SceneItem *item) :
}
float_t UIBorder::getContentWidth() {
if(this->texture != nullptr) return this->texture->getWidth();
return this->width;
return this->width - this->borderSize._realValue.x * 2.0f;
}
float_t UIBorder::getContentHeight() {
if(this->texture != nullptr) return this->texture->getHeight();
return this->height;
return this->height - this->borderSize._realValue.y * 2.0f;
}
float_t UIBorder::getChildOffsetX() {