wrap hbox up instead of down?
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
- Kia
- Eileen-Class Veteran
- Posts: 1040
- Joined: Fri Aug 01, 2014 7:49 am
- Deviantart: KiaAzad
- Discord: Kia#6810
- Contact:
wrap hbox up instead of down?
I've tried to fill an hbox from bottom up but it seems like the box_wrap always wraps down to the next row. I know I can remedy it using the `box_wrap_spacing` or transforms, but I'm wondering if there's something obvious like `box_wrap "up` that I've missed before suggesting it to be added.
Re: wrap hbox up instead of down?
Could you... hm... draw how it looks right now and how it should look like?
- Kia
- Eileen-Class Veteran
- Posts: 1040
- Joined: Fri Aug 01, 2014 7:49 am
- Deviantart: KiaAzad
- Discord: Kia#6810
- Contact:
Re: wrap hbox up instead of down?
here's the code to a hacky way to do it, but as you can guess, it wouldn't work in cases that the items in the box have varied sizes:
Code: Select all
screen hboxtest:
frame:
xysize 300,300
hbox:
align .5,1.0 box_wrap True box_wrap_spacing -100
for i in range(12):
frame:
xysize 50,50
Re: wrap hbox up instead of down?
Kind of workaround...
Code: Select all
transform flip_tr:
yzoom -1
screen test_scr():
frame:
xysize 300,300
hbox:
#box_reverse True
align .5,1.0 box_wrap True
at flip_tr
for i in range(12):
frame:
at flip_tr
xysize 50,50
text "[i]" align 0.5, 0.5
- Kia
- Eileen-Class Veteran
- Posts: 1040
- Joined: Fri Aug 01, 2014 7:49 am
- Deviantart: KiaAzad
- Discord: Kia#6810
- Contact:
Re: wrap hbox up instead of down?
well, I did think of that as well, but it would be better to have it addressed directly instead of using tricks to accomplish it.
since I usually use transforms to animate the individual items, having them flipped too adds another layer of complexity to the mix and makes the code heavier.
my intention was to make sure such a thing doesn't already exist before suggesting it.
since I usually use transforms to animate the individual items, having them flipped too adds another layer of complexity to the mix and makes the code heavier.
my intention was to make sure such a thing doesn't already exist before suggesting it.
Re: wrap hbox up instead of down?
Well, you could try to open renpy_folder/renpy/display/layout.py and search for lines
Code: Select all
if box_wrap and remwidth - sw - padding < 0 and line:
maxx, maxy = layout_line(line, target_width - x, 0)
y += line_height + box_wrap_spacing
x = 0
line_height = 0
remwidth = width
line = [ ]
Code: Select all
if box_wrap and remwidth - sw - padding < 0 and line:
maxx, maxy = layout_line(line, (target_width - x), 0)
if box_wrap == 'up':
y -= line_height + box_wrap_spacing
else:
y += line_height + box_wrap_spacing
x = 0
line_height = 0
remwidth = width
line = [ ]
Code: Select all
box_wrap 'up'
- Kia
- Eileen-Class Veteran
- Posts: 1040
- Joined: Fri Aug 01, 2014 7:49 am
- Deviantart: KiaAzad
- Discord: Kia#6810
- Contact:
Re: wrap hbox up instead of down?
since you've already done the work, I think you should suggest it to be added to renpy's code on github for the next version. ^^
Who is online
Users browsing this forum: Google [Bot], Ocelot