- Jun 11, 2020
- 59
- 130
In the game I'm making I want there to be a persistent screen that occupies the bottom 30% of the screen. The screen will have 2 parts. The left will contain a list of choices you can scroll through and the right will contain a textbox that shows a description of a choice when you hover over it. The left part needs to occupy 40% of total screen width and the right should occupy the other other 60%. But I'm having so much trouble getting this textbox on the right to work. No matter what I try, the text it contains seems to escape from the container and slide off the screen. This is the current code:
```
screen fixed_corner_menu():
style_group "choice"
vpgrid:
cols 2
rows 1
spacing 5
ysize 0.3
xsize 0.95
xalign 0.0
yalign 0.95
vpgrid:
cols 1
spacing 5
draggable True
mousewheel True
xsize 0.8
scrollbars "vertical"
# Since we have scrollbars, this positions the side, rather than
# the vpgrid.
# xalign 0.1
# yalign 0.9
# Add your menu items here using 'textbutton' or other UI elements
buttons
frame:
xsize 1400
ysize 1.0
xalign 0.0
xpadding 40
ypadding 30
text "content"
```
No matter what configuration of xsize and xalign I try on the frame the problem with the text going out of the container remains. And I have 2 wider problems with the screen itself. I use the show screen command to show the screen persistently, it appears behind the background image of my nvl dialogue. That background image is just pure black for now so it looks much darker. Also, when I show the screen you can still click on other areas of the screen to move forward without making a choice which crashes the game because the areas after the choice depend on variables set by the choice. So I also need a way to block those interactions.
Edit:
Ok I got the issue fixed by changing the formatting of the screen to this:
screen choice_menu():
style_group "choice"
frame background Solid('#2222'): #mostly transparent background. change to taste
xcenter 0.5 xsize 0.99
yanchor 1.0 ysize 0.3 ypos 1.0 yoffset -32
vpgrid:
cols 1
spacing 5
draggable True
mousewheel True
xsize 0.53
scrollbars "vertical"
# Add your menu items here using 'textbutton' or other UI elements
content.
frame: #right text desctiption
ycenter 0.5 ysize 1.0
xalign 1.0 xoffset -16 xsize 0.45
text '[tt]'
But the problems with the show screen thing yet remain.
```
screen fixed_corner_menu():
style_group "choice"
vpgrid:
cols 2
rows 1
spacing 5
ysize 0.3
xsize 0.95
xalign 0.0
yalign 0.95
vpgrid:
cols 1
spacing 5
draggable True
mousewheel True
xsize 0.8
scrollbars "vertical"
# Since we have scrollbars, this positions the side, rather than
# the vpgrid.
# xalign 0.1
# yalign 0.9
# Add your menu items here using 'textbutton' or other UI elements
buttons
frame:
xsize 1400
ysize 1.0
xalign 0.0
xpadding 40
ypadding 30
text "content"
```
No matter what configuration of xsize and xalign I try on the frame the problem with the text going out of the container remains. And I have 2 wider problems with the screen itself. I use the show screen command to show the screen persistently, it appears behind the background image of my nvl dialogue. That background image is just pure black for now so it looks much darker. Also, when I show the screen you can still click on other areas of the screen to move forward without making a choice which crashes the game because the areas after the choice depend on variables set by the choice. So I also need a way to block those interactions.
Edit:
Ok I got the issue fixed by changing the formatting of the screen to this:
screen choice_menu():
style_group "choice"
frame background Solid('#2222'): #mostly transparent background. change to taste
xcenter 0.5 xsize 0.99
yanchor 1.0 ysize 0.3 ypos 1.0 yoffset -32
vpgrid:
cols 1
spacing 5
draggable True
mousewheel True
xsize 0.53
scrollbars "vertical"
# Add your menu items here using 'textbutton' or other UI elements
content.
frame: #right text desctiption
ycenter 0.5 ysize 1.0
xalign 1.0 xoffset -16 xsize 0.45
text '[tt]'
But the problems with the show screen thing yet remain.
Last edited: