[SOLVED] Viewport is Overlapping Text

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
User avatar
screamingpenguin
Regular
Posts: 32
Joined: Mon Dec 11, 2017 5:11 am
Projects: Hollow Voices
Contact:

[SOLVED] Viewport is Overlapping Text

#1 Post by screamingpenguin »

Soo, I'm trying to work out a character profile thing and on the screen I have a vbox to contain their favourite items, yeah?
However, my problem is that the text overlaps instead of displaying underneath each other as I am expecting it to. I've narrowed it down to the viewport being at fault here, as it works properly outside of a viewport. But however, considering it is a list with a ton of items in limited space, the viewport is needed.

Code: Select all

screen hideakiprofile:
    image "profiles/profile hideaki.png":
        xalign 0.5
        yalign 0.5
             
    vbox: 
        xpos 990
        ypos 615
        viewport:
                mousewheel True
                scrollbars "vertical"
                xmaximum 420
                ymaximum 385
                if known_hideakifavitem1:
                    text "[BeeMovie]":
                        outlines [ (2, "#535353") ]
                        size 35
                if known_hideakifavitem2:
                    text "[CeleryStick]":
                        outlines [ (2, "#535353") ]
                        size 35
By overlapping, this is what I mean:

Image

Any help would be much appreciated, thank you :)
Last edited by screamingpenguin on Mon Dec 18, 2017 10:58 pm, edited 1 time in total.

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

Re: Viewport is Overlapping Text

#2 Post by xavimat »

Put the vbox INSIDE the viewport, not the viewport inside the vbox.
The viewport creates a FIXED, and puts its children inside it. The fixed does not organize the elements, but puts all of them at the top-left corner (align (0.0, 0.0)) if you don't specify otherwise.
On the contrary, the vbox organizes the children vertically, as you need here.
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
screamingpenguin
Regular
Posts: 32
Joined: Mon Dec 11, 2017 5:11 am
Projects: Hollow Voices
Contact:

Re: Viewport is Overlapping Text

#3 Post by screamingpenguin »

xavimat wrote: Mon Dec 18, 2017 9:45 am Put the vbox INSIDE the viewport, not the viewport inside the vbox.
The viewport creates a FIXED, and puts its children inside it. The fixed does not organize the elements, but puts all of them at the top-left corner (align (0.0, 0.0)) if you don't specify otherwise.
On the contrary, the vbox organizes the children vertically, as you need here.
Ohhh thank you! It's all working now!
This is why I shouldn't code late at night haha. Thanks for your help! :D

Post Reply

Who is online

Users browsing this forum: Google [Bot]