Using Mouse to Place the Cursor in an Input 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
User avatar
Sumoslap
Regular
Posts: 59
Joined: Tue Oct 12, 2010 10:02 pm
Contact:

Using Mouse to Place the Cursor in an Input Screen

#1 Post by Sumoslap » Tue Apr 19, 2022 2:40 pm

Hi all--very grateful for all the help I've received so far. I hope this one is an easy one.

My game makes heavy use of text input screens.Is there a way to format all input screens so that players can place the cursor anywhere in the input box? Basically, i want to make it easier for players to edit text. Right now, you can use the arrow keys to move the cursor around inside the input box, but when you have inputted, say, 200 characters, using the arrow keys can be annoying.

My intermediate ask is this: is there a way to double-click on a word in input to highlight it? A way to hold down the left mouse to highlight text? These are functions everyone is used to now when it comes to online input, so it would be great to duplicate it here.

Thanks much for all replies!

jeffster
Regular
Posts: 123
Joined: Wed Feb 03, 2021 9:55 pm
Contact:

Re: Using Mouse to Place the Cursor in an Input Screen

#2 Post by jeffster » Fri Apr 22, 2022 12:28 pm

Ren'Py uses pygame library to show displayables and to interact with human input. You can find some "pygame text editor" online and adapt (a part of) its code for Ren'Py, making your own editable text area.

Though I don't think that many players would like to input much text in a game. Maybe it would be easier to offer them lists of options to select.

User avatar
Sumoslap
Regular
Posts: 59
Joined: Tue Oct 12, 2010 10:02 pm
Contact:

Re: Using Mouse to Place the Cursor in an Input Screen

#3 Post by Sumoslap » Mon Apr 25, 2022 6:34 pm

Thank you, Jeffster! I will investigate this later in the week.

I hear what you're saying. I am creating something very different from a traditional visual novel. It's a tool for creating player-character backgrounds for tabletop RPGs. As such, folks will be writing a little more.

Post Reply

Who is online

Users browsing this forum: enaielei