- May 24, 2020
- 160
- 79
Hey there, everyone.
I'm trying to find a clever solution for the arrangement of text in screens for a character profile.
I found a very convoluted solution and I am very intrigued and positive, that there must be a smarter implementation.
What I basically want is this:
The hbox has two vboxes:
vbox 1 has the title of the information (name, birthday, whatever)
vbox 2 has the information for that specific character (Test, 01.01.2000)
So in the end we get a nice screen with:
name: Test
Birthday: 01.01.2000
Additional information/rumors: Really long ass text, that has information on Test, but is so long, that it need another line"
etc.
with the title of the information being on the right of the vbox right next to the corresponding information.
Sadly, that implementation makes use of \n for longer texts and is therefore quite unelegant.
Another problem, that occurs, is that in the mobile version for example, the font size changes, which then breaks the entire screen with crooked boxes etc., because some texts, that were short enough in the pc-version fit to fit in one line, now suddenly becomes two lines, due to the increased fontsize.
So I'm basically looking for a solution, that doesn't involve \n in those texts.
So I tried this:
That's also working okayish. However, each hbox now is always aligned on the left and the unity of the first example is missing (The one, where you could insert xalign 1.0)
Does anyone got an elegant solution?
Because I could use method 1 and adjust it for the mobile version, but I think, that there must be an elegant solution here, that I have overlooked.
Thanks in advance.
I'm trying to find a clever solution for the arrangement of text in screens for a character profile.
I found a very convoluted solution and I am very intrigued and positive, that there must be a smarter implementation.
What I basically want is this:
Python:
#Box which has the information on the character
frame:
area (520, 180, 1350, 790)
viewport:
scrollbars "vertical"
mousewheel True
draggable True
hbox:
vbox:
spacing 20
text "Nickname: " xalign 1.0
text "Birthday: " xalign 1.0
text "Additional information/rumors: \n" xalign 1.0
text " " xalign 1.0
text "Character: " xalign 1.0
text " " xalign 1.0
vbox:
spacing 20
text "Test"
text "01.01.2000"
text "Really long ass text, that has information on Test, but is so long, that it need another line"
text "Another short information"
text "Stupid"
text "Nice"
vbox 1 has the title of the information (name, birthday, whatever)
vbox 2 has the information for that specific character (Test, 01.01.2000)
So in the end we get a nice screen with:
name: Test
Birthday: 01.01.2000
Additional information/rumors: Really long ass text, that has information on Test, but is so long, that it need another line"
etc.
with the title of the information being on the right of the vbox right next to the corresponding information.
Sadly, that implementation makes use of \n for longer texts and is therefore quite unelegant.
Another problem, that occurs, is that in the mobile version for example, the font size changes, which then breaks the entire screen with crooked boxes etc., because some texts, that were short enough in the pc-version fit to fit in one line, now suddenly becomes two lines, due to the increased fontsize.
So I'm basically looking for a solution, that doesn't involve \n in those texts.
So I tried this:
Python:
frame:
area (520, 180, 1350, 790)
viewport:
scrollbars "vertical"
mousewheel True
draggable True
vbox:
spacing 20
hbox:
text "Nickname: "
text "Test2"
hbox:
text "Birthday: "
text "01.01.2000"
hbox:
text "Character: "
vbox:
text "Stupid"
text "Nice"
That's also working okayish. However, each hbox now is always aligned on the left and the unity of the first example is missing (The one, where you could insert xalign 1.0)
Does anyone got an elegant solution?
Because I could use method 1 and adjust it for the mobile version, but I think, that there must be an elegant solution here, that I have overlooked.
Thanks in advance.