Additionally, I want to add a button in the options to allow the player to turn it on/off.
![Image](https://i.imgur.com/6eodr3i.png)
Code: Select all
init python:
style.say_dialogue['rollback'].color="#FC5580"
style.say_thought['rollback'].color="#FC5580"
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.
![]()
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
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
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
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)
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)
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
Users browsing this forum: Google [Bot], Majestic-12 [Bot]