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

How to fix this name bug?

#1 Post by LiveTurkey » Sat Aug 04, 2018 5:08 pm

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: 3044
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: How to fix this name bug?

#2 Post by Imperf3kt » 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"

Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
Free Android GUI - Updated occasionally

User avatar
LiveTurkey
Regular
Posts: 104
Joined: Tue Dec 27, 2016 10:50 pm
Location: Brooklyn
Contact:

Re: How to fix this name bug?

#3 Post by LiveTurkey » Sat Aug 04, 2018 6:04 pm

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: 746
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 & 2
Projects: the Phantom Flier
itch: per-k-grok
Location: Sverige
Contact:

Re: How to fix this name bug?

#4 Post by Per K Grok » Sun Aug 05, 2018 2:00 am

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: Bing [Bot]