(Solved) Regards vpgrid with indefinite children sizes

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
andriodmactemporary
Regular
Posts: 27
Joined: Mon Jan 25, 2021 5:35 pm
Contact:

(Solved) Regards vpgrid with indefinite children sizes

#1 Post by andriodmactemporary » Mon Apr 05, 2021 10:50 am

How to create vpgrid which consists of children of different dimensions/sizes ?
Last edited by andriodmactemporary on Tue Apr 06, 2021 9:20 am, edited 1 time in total.

User avatar
Alex
Lemma-Class Veteran
Posts: 2779
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Regards vpgrid with indefinite children sizes

#2 Post by Alex » Mon Apr 05, 2021 11:37 am

Could you draw how it should looks like?

andriodmactemporary
Regular
Posts: 27
Joined: Mon Jan 25, 2021 5:35 pm
Contact:

Re: Regards vpgrid with indefinite children sizes

#3 Post by andriodmactemporary » Mon Apr 05, 2021 4:40 pm

Image

Here every message is of the same size, but when I insert an image (for ex, dimension of 128x128) in this vpgrid, that image is being overlapped on the messages.

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1233
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Regards vpgrid with indefinite children sizes

#4 Post by Ocelot » Mon Apr 05, 2021 4:50 pm

Why vpgrid? Why not viewport and vbox?
< < insert Rick Cook quote here > >

andriodmactemporary
Regular
Posts: 27
Joined: Mon Jan 25, 2021 5:35 pm
Contact:

Re: Regards vpgrid with indefinite children sizes

#5 Post by andriodmactemporary » Mon Apr 05, 2021 4:59 pm

Ocelot wrote:
Mon Apr 05, 2021 4:50 pm
Why vpgrid? Why not viewport and vbox?
Can't use the viewport because it is being displayed at the corner of the screen.
Also, can't use vbox because I need a component with scrolling functionality because messages will be added dynamically.

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1233
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Regards vpgrid with indefinite children sizes

#6 Post by Ocelot » Mon Apr 05, 2021 5:49 pm

You can place viewport anywhere with any size, including in the corner of the screen. Internally vpgrid is literally a viewport, if you couldn't do something with viewport, you wouldn't be able to do this with vpgrid. And if you add vbox with all messages (dynamically filled) it will have scrollbars natively.

Proof of concept using viewport and vbox
Image
Attachments
TEST61809.zip
(890.31 KiB) Downloaded 6 times
< < insert Rick Cook quote here > >

andriodmactemporary
Regular
Posts: 27
Joined: Mon Jan 25, 2021 5:35 pm
Contact:

Re: Regards vpgrid with indefinite children sizes

#7 Post by andriodmactemporary » Tue Apr 06, 2021 9:19 am

Ocelot wrote:
Mon Apr 05, 2021 5:49 pm
You can place viewport anywhere with any size, including in the corner of the screen. Internally vpgrid is literally a viewport, if you couldn't do something with viewport, you wouldn't be able to do this with vpgrid. And if you add vbox with all messages (dynamically filled) it will have scrollbars natively.

Proof of concept using viewport and vbox
Image
Thanks, your logic has solved my problem (it has solved with "has vbox" syntax).

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1233
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: (Solved) Regards vpgrid with indefinite children sizes

#8 Post by Ocelot » Tue Apr 06, 2021 11:27 am

has vbox is just a shorthand for writing vbox: and indenting everything below one level. Also I was bored and made message window autoscroll to the bottom when new message is added. Post if you need it.
< < insert Rick Cook quote here > >

andriodmactemporary
Regular
Posts: 27
Joined: Mon Jan 25, 2021 5:35 pm
Contact:

Re: (Solved) Regards vpgrid with indefinite children sizes

#9 Post by andriodmactemporary » Wed Apr 07, 2021 8:45 am

Ocelot wrote:
Tue Apr 06, 2021 11:27 am
has vbox is just a shorthand for writing vbox: and indenting everything below one level. Also I was bored and made message window autoscroll to the bottom when new message is added. Post if you need it.
Thanks a lot for the clarification, also, I have logic for auto-scrolling so, thanks.

Post Reply

Who is online

Users browsing this forum: Google [Bot]