Problems with custom screen

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
rag_exe21
Newbie
Posts: 3
Joined: Sun Sep 10, 2023 5:02 pm
Contact:

Problems with custom screen

#1 Post by rag_exe21 »

I'm working on a visual novel, but I run into an annoying problem, when I restart the game using shift + r or open the game and it reloads from where it left off, the screen elements I created are all in one corner but it's not what I defined. What could be causing this?

User avatar
plastiekk
Regular
Posts: 112
Joined: Wed Sep 29, 2021 4:08 am
Contact:

Re: Problems with custom screen

#2 Post by plastiekk »

rag_exe21 wrote: Sun Sep 10, 2023 5:08 pm ...I created are all in one corner but it's not what I defined.
Just a thought, because you mention define. Try default.

Code: Select all

default my_var = 0.5    # instead of define
Why on earth did I put the bread in the fridge?

rag_exe21
Newbie
Posts: 3
Joined: Sun Sep 10, 2023 5:02 pm
Contact:

Re: Problems with custom screen

#3 Post by rag_exe21 »

plastiekk wrote: Wed Sep 13, 2023 3:52 am
rag_exe21 wrote: Sun Sep 10, 2023 5:08 pm ...I created are all in one corner but it's not what I defined.
Just a thought, because you mention define. Try default.

Code: Select all

default my_var = 0.5    # instead of define
Not this, im sorry. My english is not much good. I meant that the screen elements don't stay where they should be when the game reloads

User avatar
plastiekk
Regular
Posts: 112
Joined: Wed Sep 29, 2021 4:08 am
Contact:

Re: Problems with custom screen

#4 Post by plastiekk »

rag_exe21 wrote: Sat Sep 16, 2023 10:59 am
plastiekk wrote: Wed Sep 13, 2023 3:52 am
rag_exe21 wrote: Sun Sep 10, 2023 5:08 pm ...I created are all in one corner but it's not what I defined.
Just a thought, because you mention define. Try default.

Code: Select all

default my_var = 0.5    # instead of define
Not this, im sorry. My english is not much good. I meant that the screen elements don't stay where they should be when the game reloads
Show your code, so we can try to help.
Why on earth did I put the bread in the fridge?

rag_exe21
Newbie
Posts: 3
Joined: Sun Sep 10, 2023 5:02 pm
Contact:

Re: Problems with custom screen

#5 Post by rag_exe21 »

here

Code: Select all

screen ui:
    zorder 100
    key "x" action ToggleScreen("developer_mode")
    if energy <= 35:
        add "images/gameUI/field_elements/damage.png":
            at health_low
    add "gui/ui_frame.png":
        ypos 10
        at uimove

    
    vbox:
        spacing 20
        at uimove2
        text "{font=fonts/HTF.ttf}H$:[gold]{/font}":
            size 65
            xpos 10
            ypos 45
            outlines [(0, "#96007d", 2, 2), (0, "#96007d", 2, 2)]
        
    add "gui/ui_frame2.png":
        xpos 1555
        at uimove3
    vbox:
        at uimove3
        text "{font=fonts/HTF.ttf}[local]{/font}":
            xpos -180 
            ypos 40
            size 75 
            xanchor -0.45
            outlines [(0, "#96007d", 2, 2), (0, "#96007d", 2, 2)] 
    hbox:
        at uimove2
        text "{image=emoji/thunder.png}" ypos 140 xpos 73
        bar:
            value VariableValue ("energy", 100, max_is_zero=False, step=2.0, action=None)
            range 100
            xysize (175,31)
            ypos 140
            xpos 80
            left_bar "gui/stats/energy_full.png"
            right_bar "gui/stats/energy_empty.png"
    if phone_unlocked == True:
        hbox:
            at uimove4
            xalign 0.07
            yalign 0.9
            
            imagebutton:
                
                xoffset -30
                yoffset 30
                auto "images/gameUI/icon_%s.png"
                action ShowMenu("StatsUI")

    if mission_unlocked == True:
        hbox:
            at uimove7
            frame:
                textbutton "Status" action ToggleScreen("stats", transition=moveoutleft)
    if in_room == True:
        add "nendo_portrait":
            at leftin
            xalign 3.0
            yalign 1.0
screen main_menu2:
    add "images/fieldbg/forest_day.png"
    vbox:
        at item_menu1
        align(5, 5)
        spacing 20
        imagebutton:
            xanchor 0.5
            yanchor 0.5
            xpos 950
            ypos 128
            auto "images/custom_menu/start_%s.png"
            action Start()
    vbox:
        at item_menu2
        align(5, 5)
        spacing 20
        imagebutton:
            xanchor 0.5
            yanchor 0.5
            xpos 950
            ypos 643
            auto "images/custom_menu/load_%s.png"
            action ShowMenu("load")

    vbox:
        at item_menu3
        align (5, 5)
        spacing 20
        imagebutton:
            xanchor 0.5
            yanchor 0.5
            xpos 950
            ypos 786
            auto "images/custom_menu/preferences_%s.png"

User avatar
plastiekk
Regular
Posts: 112
Joined: Wed Sep 29, 2021 4:08 am
Contact:

Re: Problems with custom screen

#6 Post by plastiekk »

rag_exe21 wrote: Sat Sep 16, 2023 5:48 pm here
To be honest, I don't see why it moves all icons up to the left corner when reloading script.
Yes, you have an xpos of -180 but the icon should then be displayed outside the screen.
Did you try to save the game regularly before reloading the script (reload by changing your code)?
How do your transforms look like?
uimove
uimove2
...
item_menu1
and so on?

Edit: Is this the same behavior when you roll back Ren'Py? I mean, are the icons then also moved to the upper left corner?
Why on earth did I put the bread in the fridge?

Post Reply

Who is online

Users browsing this forum: Amazon [Bot]