Truncated Images in Screen Language [SOLVED]

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
IsharaComix
Newbie
Posts: 19
Joined: Tue Jan 06, 2009 11:17 pm
Projects: @CameliaGirls
Location: NC, USA
Contact:

Truncated Images in Screen Language [SOLVED]

#1 Post by IsharaComix »

I'm practicing with Screen Language, and I'm hitting a bit of a bump in the road. Rather than trying to explain my problem, here are two short videos showing what's going wrong.

Here's what happens in Ren'Py 6.11.2: http://isharacomix.com/STUFF/bugreport.ogv
Here's what happens in Ren'Py 6.12b: http://isharacomix.com/STUFF/bugreport2.ogv (with OpenGL enabled. If OpenGL is explicitly disabled, it looks exactly like the first video).

In the first video, the images, when added, get truncated by the borders of the screen. In the second video... well... I have no idea what's going on, but at least the images aren't being truncated.

Here's the code for the frame on the lower left that contains everything we're dealing with.

Code: Select all

frame:
    hbox:
        xmaximum 300 xfill True
        
        viewport id "ourevents":
            xmaximum 275
            
            draggable True
            
            # The actual event box.
            hbox:
                vbox:
                    xfill True
                    $ count = 0
                    for e in events:
                        if e[0] == [day,month,year]:
                            button:
                                xfill True
                                hbox:
                                    fixed:
                                        ymaximum 50 xmaximum 80 xfill True
                                        $ x = 0
#------------------------------------>  # Right here, we are picking up the names of the images and adding them to the buttons.
                                        for p in e[4]:
                                            add ("pic_"+p.lower()+".png" ) xpos x
                                            # This evaluates to 'add "pic_alice.png" xpos x
                                            # Even when the 'add' line is commented out, the screen still flickers in 6.12 w/ OpenGL
                                            $ x += 7
                                    vbox:
                                        text e[2] size 18 color If(selected_event == count, "#ffff00", "#ffffff")
                                        text e[3] size 16 color If(selected_event == count, "#ffff00", "#ffffff")
                                        $ kids = ""
                                        for s in e[4]:
                                            $ kids += s + ", "
                                        $ kids = kids[:len(kids)-2]
                                        if len(kids) > 0:
                                            text ("w/ "+kids) size 14 color If(selected_event == count, "#ffff00", "#ffffff")
                                        text ("from "+utils.timestring(e[1])) size 16 color If(selected_event == count, "#ffff00", "#ffffff")
                                
                                action SetVariable("selected_event",count)
                        $ count += 1
        
        vbar value YScrollValue("ourevents") unscrollable "hide" xalign 1.0
Anyone have ideas as to what's going on, or any workarounds to achieve the effect I'm going for?
Last edited by IsharaComix on Wed Feb 02, 2011 8:04 am, edited 1 time in total.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Truncated Images in Screen Language

#2 Post by PyTom »

Can I ask you to put together a small demo of the bug, so I can run it here and test it? That would help me figure out what's going on.

Thanks!
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

IsharaComix
Newbie
Posts: 19
Joined: Tue Jan 06, 2009 11:17 pm
Projects: @CameliaGirls
Location: NC, USA
Contact:

Re: Truncated Images in Screen Language

#3 Post by IsharaComix »

Here's the source code for a project where the truncation and flickering glitches occur, if you run it on 6.12, remember to force software rendering: http://isharacomix.com/STUFF/bugreport_demo.tar

If there's anything else I can do to help, just let me know, either here or on IRC.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Truncated Images in Screen Language

#4 Post by PyTom »

Okay, the cause of the truncated images was the fixed containing them. The problem is that a fixed sizes itself to take the space available to it. When you stick it inside a viewport, and don't tell the viewport otherwise, the space available is limited to the size of the viewport. So what happened is that as you got close to the bottom of the viewport, the bottom fixed cut off when there was no space left. As you went further, other fixeds were cut off entirely.

The key is to give the fixed a minimum size - but there isn't a good way to do this. In 6.12.0c, you will be able to write:

Code: Select all

fixed:
    xmaximum 50 ymaximum 80
    xminimum 50 yminimum 80
To give it an exact size.

I don't know what is causing the flickering. I'm going to add some error-checking which might help us diagnose this - it may also be some sort of driver problem, since it doesn't happen here.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

IsharaComix
Newbie
Posts: 19
Joined: Tue Jan 06, 2009 11:17 pm
Projects: @CameliaGirls
Location: NC, USA
Contact:

Re: Truncated Images in Screen Language

#5 Post by IsharaComix »

Since I've posted this report, I had a few of my friends run the code too, and they didn't get any flickering either. I'm not really worried about it (I bring this upon myself by using outdated drivers), but I'll be happy to run any diagnostics you need to narrow down the problem.

Of course, you've addressed my main problem. Thanks for your time and effort, and I hope it ends up being worth the trouble in the long run.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], NoFanru