Enter character name code in nvl mode

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
_LadyBex_
Newbie
Posts: 8
Joined: Fri Apr 19, 2019 3:31 pm
itch: ladybex
Contact:

Enter character name code in nvl mode

#1 Post by _LadyBex_ »

Hello :) I need your help! This thing worked for me before, but after I've lost all of my pc data and went to code anew it didn't work. I want "Enter name" and "Lilith" below it to be in the center of the screen like in a nvl mode, but for all the rest of the text I want it to be in ADV style.

define l = Character("[pov]", color="#CA170C")

label start:

$ pov = renpy.input("Enter name", default='Lilith', allow="", exclude='{}', length=None, with_none=None, pixel_width=None, mask=None, copypaste=True, multiline=False,) or "Lilith"

$ pov.strip()

What do I need to add to the code so it gets in the center of the screen. I've tried many things, but they all failed.

User avatar
_ticlock_
Miko-Class Veteran
Posts: 910
Joined: Mon Oct 26, 2020 5:41 pm
Contact:

Re: Enter character name code in nvl mode

#2 Post by _ticlock_ »

_LadyBex_ wrote: Sat May 27, 2023 5:08 pm What do I need to add to the code so it gets in the center of the screen. I've tried many things, but they all failed.
renpy.input uses screen input(screens.rpy)

You can change this screen to fit your needs, for example:

EDIT:

Code: Select all

screen input(prompt):
    style_prefix "input"

    frame:
        yalign 0.5
        background "#888"

        vbox:
            xanchor gui.dialogue_text_xalign
            xpos gui.dialogue_xpos
            xsize gui.dialogue_width
            ypos gui.dialogue_ypos

            text prompt style "input_prompt"
            input id "input"
Last edited by _ticlock_ on Sun May 28, 2023 4:59 pm, edited 1 time in total.

_LadyBex_
Newbie
Posts: 8
Joined: Fri Apr 19, 2019 3:31 pm
itch: ladybex
Contact:

Re: Enter character name code in nvl mode

#3 Post by _LadyBex_ »

_ticlock_ wrote: Sat May 27, 2023 7:27 pm
_LadyBex_ wrote: Sat May 27, 2023 5:08 pm What do I need to add to the code so it gets in the center of the screen. I've tried many things, but they all failed.
renpy.input uses screen input(screens.rpy)

You can change this screen to fit your needs, for example:

Code: Select all


screen input(prompt):
    style_prefix "input"

    frame:
        yalign 0.5
        background "#888"

        vbox:
            xalign gui.dialogue_text_xalign
            xpos gui.dialogue_xpos
            xsize gui.dialogue_width
            ypos gui.dialogue_ypos

            text prompt style "input_prompt"
            input id "input"
When I tried it I got an error :( I am sorry, my skills are quite low so if you could please explain what am I doing wrong

Code: Select all

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/screens.rpy", line 184: keyword argument 'xpos' is incompatible with 'xalign'.
    xpos gui.dialogue_xpos
        ^

Ren'Py Version: Ren'Py 8.1.0.23051307
Sun May 28 11:48:48 2023

jeffster
Miko-Class Veteran
Posts: 520
Joined: Wed Feb 03, 2021 9:55 pm
Contact:

Re: Enter character name code in nvl mode

#4 Post by jeffster »

As the error message says, you can't use both xalign and xpos. Just delete "xalign" line. You can check the original screen input in the standard file "screens.rpy", and the style parameters in file "gui.rpy".
If the problem is solved, please edit the original post and add [SOLVED] to the title. 8)

User avatar
_ticlock_
Miko-Class Veteran
Posts: 910
Joined: Mon Oct 26, 2020 5:41 pm
Contact:

Re: Enter character name code in nvl mode

#5 Post by _ticlock_ »

_LadyBex_ wrote: Sun May 28, 2023 5:51 am

Code: Select all

File "game/screens.rpy", line 184: keyword argument 'xpos' is incompatible with 'xalign'.
    xpos gui.dialogue_xpos
Right. I copied it from an older version. jeffster is correct. You can replace xalign to xanchor to fix the error. I edited the code above.

Note: You don't need to use default style properties, you can change them to ones you actually need. It was just an example.

_LadyBex_
Newbie
Posts: 8
Joined: Fri Apr 19, 2019 3:31 pm
itch: ladybex
Contact:

Re: Enter character name code in nvl mode

#6 Post by _LadyBex_ »

Thank you all it works fine now :D

Post Reply

Who is online

Users browsing this forum: No registered users