How to change text color in say screen after player read it.
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.
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.
-
- Regular
- Posts: 137
- Joined: Mon Sep 09, 2019 10:31 am
- Completed: re:shape, Monster Boys Doctor, Hearts and Hexes, The Prince's Heart, Dragon Gazer
- Projects: Motifs, Longing for Change, The Sinking of the Dream Chaser, Town of the Damned, Monster Boy Wars
- Organization: Funigami
- itch: funigami
- Discord: alexei#5190
- Contact:
How to change text color in say screen after player read it.
As the title suggests, I want to change the textbox color after someone read the text and moved on. So, when they click back, I want the text to have a different color to suggest it's already seen/read. Any idea how to do this?
Additionally, I want to add a button in the options to allow the player to turn it on/off.
Additionally, I want to add a button in the options to allow the player to turn it on/off.
Last edited by alexei on Fri Sep 16, 2022 3:25 pm, edited 1 time in total.
-
- Regular
- Posts: 137
- Joined: Mon Sep 09, 2019 10:31 am
- Completed: re:shape, Monster Boys Doctor, Hearts and Hexes, The Prince's Heart, Dragon Gazer
- Projects: Motifs, Longing for Change, The Sinking of the Dream Chaser, Town of the Damned, Monster Boy Wars
- Organization: Funigami
- itch: funigami
- Discord: alexei#5190
- Contact:
Re: [SOLVED] How to change text color in say screen after player read it.
I found a solution. You just place:
And it will get the job done.
Code: Select all
init python:
style.say_dialogue['rollback'].color="#FC5580"
style.say_thought['rollback'].color="#FC5580"
And it will get the job done.
Re: [SOLVED] How to change text color in say screen after player read it.
https://www.renpy.org/doc/html/other.html#renpy.is_seenalexei wrote: ↑Tue Sep 13, 2022 1:42 pm As the title suggests, I want to change the textbox color after someone read the text and moved on. So, when they click back, I want the text to have a different color to suggest it's already seen/read. Any idea how to do this?
Additionally, I want to add a button in the options to allow the player to turn it on/off.
screen.rpy
Code: Select all
screen say(who, what):
style_prefix "say"
zorder 50
window:
id "window"
background Transform(Frame("gui/textbox.png",xpos=0, ypos=1), alpha=persistent.dialogueBoxOpacity)
if who is not None:
window:
id "namebox"
style "namebox"
text who id "who"
####################
if persistent.renpy_is_seen and renpy.is_seen():
text what id "what" color "#77f"
else:
text what id "what"
###############
## If there's a side image, display it above the text. Do not display on the
## phone variant - there's no room.
if not renpy.variant("small"):
add SideImage() xalign 0.0 yalign 1.0
Last edited by Andredron on Mon Dec 05, 2022 1:17 am, edited 4 times in total.
Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18
Sawa - a game of the Drow Nation
Honest Critique
Poses in visual novels, or how to hold a character properly in the frame
Help save articles to the webarchive. [/color]
Sawa - a game of the Drow Nation
Honest Critique
Poses in visual novels, or how to hold a character properly in the frame
Help save articles to the webarchive. [/color]
Re: [SOLVED] How to change text color in say screen after player read it.
How to register a button to enable or disable the mode in the settings, I know, but I don’t understand how to attach say to the screen
viewtopic.php?f=51&t=65301
You can redo my code to activate the YouTube mode, but there are no ideas how to do it so that the axis is turned off in the settings. Above I threw the code so that the text would always be in a different color when passing
viewtopic.php?f=51&t=65301
You can redo my code to activate the YouTube mode, but there are no ideas how to do it so that the axis is turned off in the settings. Above I threw the code so that the text would always be in a different color when passing
Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18
Sawa - a game of the Drow Nation
Honest Critique
Poses in visual novels, or how to hold a character properly in the frame
Help save articles to the webarchive. [/color]
Sawa - a game of the Drow Nation
Honest Critique
Poses in visual novels, or how to hold a character properly in the frame
Help save articles to the webarchive. [/color]
-
- Regular
- Posts: 137
- Joined: Mon Sep 09, 2019 10:31 am
- Completed: re:shape, Monster Boys Doctor, Hearts and Hexes, The Prince's Heart, Dragon Gazer
- Projects: Motifs, Longing for Change, The Sinking of the Dream Chaser, Town of the Damned, Monster Boy Wars
- Organization: Funigami
- itch: funigami
- Discord: alexei#5190
- Contact:
Re: [SOLVED] How to change text color in say screen after player read it.
Cool, I'll give it a try. It looks more robust than what I did. Thanks for this!Andredron wrote: ↑Wed Sep 14, 2022 6:07 amhttps://www.renpy.org/doc/html/other.html#renpy.is_seenalexei wrote: ↑Tue Sep 13, 2022 1:42 pm As the title suggests, I want to change the textbox color after someone read the text and moved on. So, when they click back, I want the text to have a different color to suggest it's already seen/read. Any idea how to do this?
Additionally, I want to add a button in the options to allow the player to turn it on/off.
screen.rpyI'm writing from my phone so there may be errors.Code: Select all
screen say(who, what): style_prefix "say" zorder 50 window: id "window" background Transform(Frame("gui/textbox.png",xpos=0, ypos=1), alpha=persistent.dialogueBoxOpacity) if who is not None: window: id "namebox" style "namebox" text who id "who" ###################### if renpy.is_seen(): text what id "what" color "#77f" else: text what id "what" ###################### ## If there's a side image, display it above the text. Do not display on the ## phone variant - there's no room. if not renpy.variant("small"): add SideImage() xalign 0.0 yalign 1.0
-
- Regular
- Posts: 137
- Joined: Mon Sep 09, 2019 10:31 am
- Completed: re:shape, Monster Boys Doctor, Hearts and Hexes, The Prince's Heart, Dragon Gazer
- Projects: Motifs, Longing for Change, The Sinking of the Dream Chaser, Town of the Damned, Monster Boy Wars
- Organization: Funigami
- itch: funigami
- Discord: alexei#5190
- Contact:
Re: [SOLVED] How to change text color in say screen after player read it.
So, I'm not at a level to understand this. I'll have to read more about it. Any idea if it can be further simplified? It looks like an overkill to me.Andredron wrote: ↑Wed Sep 14, 2022 6:31 am How to register a button to enable or disable the mode in the settings, I know, but I don’t understand how to attach say to the screen
viewtopic.php?f=51&t=65301
You can redo my code to activate the YouTube mode, but there are no ideas how to do it so that the axis is turned off in the settings. Above I threw the code so that the text would always be in a different color when passing
Re: How to change text color in say screen after player read it.
From the phone I write something like this, but I could be wrong
Code: Select all
init python:
# Set the default value.
if persistent.renpy.is_seen is None:
persistent.renpy.is_seen = False
Code: Select all
label _("Read text")
textbutton _("Enabled") action SetField(persistent, "renpy.is_seen", True)
textbutton _("Disabled") action SetField(persistent, "renpy.is_seen", False)
Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18
Sawa - a game of the Drow Nation
Honest Critique
Poses in visual novels, or how to hold a character properly in the frame
Help save articles to the webarchive. [/color]
Sawa - a game of the Drow Nation
Honest Critique
Poses in visual novels, or how to hold a character properly in the frame
Help save articles to the webarchive. [/color]
-
- Regular
- Posts: 137
- Joined: Mon Sep 09, 2019 10:31 am
- Completed: re:shape, Monster Boys Doctor, Hearts and Hexes, The Prince's Heart, Dragon Gazer
- Projects: Motifs, Longing for Change, The Sinking of the Dream Chaser, Town of the Damned, Monster Boy Wars
- Organization: Funigami
- itch: funigami
- Discord: alexei#5190
- Contact:
Re: How to change text color in say screen after player read it.
cool, thanks!Andredron wrote: ↑Fri Sep 16, 2022 4:02 pm From the phone I write something like this, but I could be wrong
Code: Select all
init python: # Set the default value. if persistent.renpy.is_seen is None: persistent.renpy.is_seen = False
Code: Select all
label _("Read text") textbutton _("Enabled") action SetField(persistent, "renpy.is_seen", True) textbutton _("Disabled") action SetField(persistent, "renpy.is_seen", False)
Should the persistent is seen be placed along with the say screen you placed above?
Re: How to change text color in say screen after player read it.
Yes
Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18
Sawa - a game of the Drow Nation
Honest Critique
Poses in visual novels, or how to hold a character properly in the frame
Help save articles to the webarchive. [/color]
Sawa - a game of the Drow Nation
Honest Critique
Poses in visual novels, or how to hold a character properly in the frame
Help save articles to the webarchive. [/color]
-
- Regular
- Posts: 137
- Joined: Mon Sep 09, 2019 10:31 am
- Completed: re:shape, Monster Boys Doctor, Hearts and Hexes, The Prince's Heart, Dragon Gazer
- Projects: Motifs, Longing for Change, The Sinking of the Dream Chaser, Town of the Damned, Monster Boy Wars
- Organization: Funigami
- itch: funigami
- Discord: alexei#5190
- Contact:
Re: How to change text color in say screen after player read it.
Here's what I'm getting.
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/gui.rpy", line 417, in script
init python:
File "game/gui.rpy", line 417, in script
init python:
File "game/gui.rpy", line 445, in <module>
if persistent.renpy.is_seen is None:
AttributeError: 'NoneType' object has no attribute 'is_seen'
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "D:\renpy\renpy-8.0.1-sdk\renpy\bootstrap.py", line 277, in bootstrap
renpy.main.main()
File "D:\renpy\renpy-8.0.1-sdk\renpy\main.py", line 558, in main
renpy.game.context().run(node)
File "game/gui.rpy", line 417, in script
init python:
File "/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python3.9/site-packages/future/utils/__init__.py", line 441, in raise_
File "game/gui.rpy", line 417, in script
init python:
File "D:\renpy\renpy-8.0.1-sdk\renpy\ast.py", line 1131, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "D:\renpy\renpy-8.0.1-sdk\renpy\python.py", line 1061, in py_exec_bytecode
exec(bytecode, globals, locals)
File "game/gui.rpy", line 445, in <module>
if persistent.renpy.is_seen is None:
AttributeError: 'NoneType' object has no attribute 'is_seen'
Windows-10-10.0.22000 AMD64
Ren'Py 8.0.3.22090809
Project Motif 0.2
Sat Sep 17 22:34:35 2022
Who is online
Users browsing this forum: No registered users