bugged viewport, frame or loop?

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
User avatar
xavimat
Eileen-Class Veteran
Posts: 1460
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love, unknown
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Contact:

bugged viewport, frame or loop?

#1 Post by xavimat »

Well, after hours struggling against this, I'm now convinced it's a bug:

I have frames inside a hbox inside a vbox inside a viewport (crazy, yes).

When filling the viewport with a for loop, it gets tired of passing the correct properties and, at some point, it gets tired of passing the actual content of the frames:
screenshot0004.png

Code: Select all

screen test():

    viewport:
        scrollbars "vertical"
        draggable True
        mousewheel True

        has vbox
        xalign .5

        hbox:
            box_wrap True
            spacing 30

            for i in range(15):
                frame:
                    xysize(300, 300)
                    bottom_margin 30
                    label "Frame " + str(i) yalign 0.0
                    text "Qfh fjksdh kjdsh fdkjshf sdhfkjdshfjk sdhf dsk" yalign 0.37
                    textbutton "Textbutton" action NullAction() yalign 1.0
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: bugged viewport, frame or loop?

#2 Post by Imperf3kt »

Why not just use vpgrid? It seems more appropriate to your needs.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
xavimat
Eileen-Class Veteran
Posts: 1460
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love, unknown
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Contact:

Re: bugged viewport, frame or loop?

#3 Post by xavimat »

Thanks for the suggestion!
I'm indeed using vpgrid now and it works well, but:
- I had, at the bottom of the viewport, a big frame with more text (this is the reason for the vbox) and I had to delete it, because vpgrid does not allow elements of different size. So, I lost functionality.
- I wanted to use the box_wrap property, so, if the total width is different, less frames are rendered in every row automatically. With vpgrid I had to dupplicate the screen using "variant", one with vpgrid cols 4 and another with vpgrid cols 1.
- In any case, this is indeed a bug and it's useful to report it. :D
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: bugged viewport, frame or loop?

#4 Post by Imperf3kt »

You could put other containers inside the vpgrid provided you make sure they're exactly the same width/height.
That way you could size each grid according to your biggest container, and then place other containers inside those to make your smaller versions.

Of course, this is probably not ideal and as you say, it probably won't handle scalability as well.

I agree the above issue indeed sounds like a bug, or at least unintended behaviour.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

DragoonHP
Miko-Class Veteran
Posts: 758
Joined: Tue Jun 22, 2010 12:54 am
Completed: Christmas
IRC Nick: DragoonHP
Location: Zion Island, Solario
Contact:

Re: bugged viewport, frame or loop?

#5 Post by DragoonHP »

Hmm. So I just tested out your code xavimat, and it works perfectly for me. Try the usual Force Recompile and see if it works?

PS: And about an alternative way to do this, you can have a vpgrid of 1 column X rows filled with fixed and each fixed can have three frames. A bit roundabout and as Imperf3kt said, probably won't scale as well.

User avatar
xavimat
Eileen-Class Veteran
Posts: 1460
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love, unknown
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Contact:

Re: bugged viewport, frame or loop?

#6 Post by xavimat »

DragoonHP wrote: Mon Nov 27, 2017 5:53 pm Hmm. So I just tested out your code xavimat, and it works perfectly for me.
So, this is just in my computer. Thanks. I'll test it in more systems.
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

Post Reply

Who is online

Users browsing this forum: No registered users