How to fix this name bug?

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
LiveTurkey
Regular
Posts: 109
Joined: Tue Dec 27, 2016 10:50 pm
Location: Brooklyn
Contact:

How to fix this name bug?

#1 Post by LiveTurkey »

So I'm trying to get the player to enter a character name and I have two minor visual bugs.

Here is a picture

Image

The first bug is that the place where you type happens directly over the place where it says "Enter your name"

The second bug is that the cursor is not where the player is typing. The player is typing where the first line begins but if you look, the cursor is to the right and up of the word "name". Where the orange meets the white.

The code I have for this is pretty simple

Code: Select all

python:
        name = renpy.input("              Enter your name", allow=" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", length=10)
        name = name.strip()

        if not name:
             name = "Anon" 
Does anyone know how to fix these two bugs?

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

Re: How to fix this name bug?

#2 Post by Imperf3kt »

I think you have some indentation errors
I suggest trying this:

Code: Select all

python:
    name = renpy.input('Enter your name', allow=' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', length=10)
    name = name.strip()

        if not name:
            name = "Anon"

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
LiveTurkey
Regular
Posts: 109
Joined: Tue Dec 27, 2016 10:50 pm
Location: Brooklyn
Contact:

Re: How to fix this name bug?

#3 Post by LiveTurkey »

Imperf3kt wrote: Sat Aug 04, 2018 5:55 pm I think you have some indentation errors
I suggest trying this:

Code: Select all

python:
    name = renpy.input('Enter your name', allow=' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', length=10)
    name = name.strip()

        if not name:
            name = "Anon"

If I get rid of the spaces, it puts "Enter your name before the red line (at the border of the text box. )

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: How to fix this name bug?

#4 Post by Per K Grok »

LiveTurkey wrote: Sat Aug 04, 2018 6:04 pm
----

If I get rid of the spaces, it puts "Enter your name before the red line (at the border of the text box. )
Move the textbox so the text is positioned where you want it in relation to the background, without using empty spaces..

Post Reply

Who is online

Users browsing this forum: Google [Bot], Tomoyo Ichijouji