[Solved] How to Define Custom Color for Typing Cursor?

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
Katy133
Miko-Class Veteran
Posts: 704
Joined: Sat Nov 16, 2013 1:21 pm
Completed: Eight Sweets, The Heart of Tales, [redacted] Life, Must Love Jaws, A Tune at the End of the World, Three Guys That Paint, The Journey of Ignorance, Portal 2.5.
Projects: The Butler Detective
Tumblr: katy-133
Deviantart: Katy133
Soundcloud: Katy133
itch: katy133
Location: Canada
Contact:

[Solved] How to Define Custom Color for Typing Cursor?

#1 Post by Katy133 »

I'm trying to figure out how to define a custom colour for the caret/"blinking typing cursor" that appears when you ask the player to input a name for the player character.

I know that the color that's effecting the colour of the name input is:

Code: Select all

define gui.accent_color = '#8c698c'
But if I change this, it'll also change the colour of other places of the interface/GUI, which I don't want; I only want to effect the caret's colour.

Is there any way to create a 'define' label (something like 'define gui.naming_colour') to just affect the caret's colour and nothing else? I'm using Ren'Py version 6.99.12
Last edited by Katy133 on Sun Jul 23, 2017 4:21 pm, edited 1 time in total.
ImageImage

My Website, which lists my visual novels.
Become a patron on my Patreon!

User avatar
Scribbles
Miko-Class Veteran
Posts: 636
Joined: Wed Sep 21, 2016 4:15 pm
Completed: Pinewood Island, As We Know It
Projects: In Blood
Organization: Jaime Scribbles Games
Deviantart: breakfastdoodles
itch: scribbles
Location: Ohio
Contact:

Re: How to Define Custom Color for Typing Cursor?

#2 Post by Scribbles »

you could try messing around with the code in the input screen under screens.rpy not 100% how to do what you want though I'm sorry. it uses the style prefix for input and then there is a bit of code at the top you could try adjusting (again, not sure how sorry)

Code: Select all

style input:
    properties gui.text_properties("input", accent=True)
    adjust_spacing False
Image - Image -Image

User avatar
Katy133
Miko-Class Veteran
Posts: 704
Joined: Sat Nov 16, 2013 1:21 pm
Completed: Eight Sweets, The Heart of Tales, [redacted] Life, Must Love Jaws, A Tune at the End of the World, Three Guys That Paint, The Journey of Ignorance, Portal 2.5.
Projects: The Butler Detective
Tumblr: katy-133
Deviantart: Katy133
Soundcloud: Katy133
itch: katy133
Location: Canada
Contact:

Re: How to Define Custom Color for Typing Cursor?

#3 Post by Katy133 »

Scribbles wrote: Sun Jul 23, 2017 9:35 am you could try messing around with the code in the input screen under screens.rpy not 100% how to do what you want though I'm sorry. it uses the style prefix for input and then there is a bit of code at the top you could try adjusting (again, not sure how sorry)

Code: Select all

style input:
    properties gui.text_properties("input", accent=True)
    adjust_spacing False
Thank you so much!

With that info, I was able to figure out where the caret's colour style was located (I didn't realise before that the caret was labeled as 'input' in Ren'Py).

I needed to edit a section from the 'screens.rpy' to this:

Code: Select all

style input:
    color gui.naming_color
And then I edited this section in the 'gui.rpy' to change the caret's/input's colour:

Code: Select all

define gui.naming_color = '#302c46'
Thanks again for the help!
ImageImage

My Website, which lists my visual novels.
Become a patron on my Patreon!

User avatar
Scribbles
Miko-Class Veteran
Posts: 636
Joined: Wed Sep 21, 2016 4:15 pm
Completed: Pinewood Island, As We Know It
Projects: In Blood
Organization: Jaime Scribbles Games
Deviantart: breakfastdoodles
itch: scribbles
Location: Ohio
Contact:

Re: [Solved] How to Define Custom Color for Typing Cursor?

#4 Post by Scribbles »

I'm glad that helped!
Image - Image -Image

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]