Sorry to post again, but I'm new to the speech bubble system. I've already make extensive changes to the default say screen to support multiple text boxes on screen at once, different colour and style say windows for each character, etc, but the same sort of thing doesn't seem to work with bubbles.
What I want, as per the title, is to have a different colour speech bubble for each character. I've created differently coloured versions of the bubble and thought bubble png files in the GUI folder, and imagined that just changing the value of bubble.frame and bubble.thoughtframe within the bubble screen so that it points at the relevant files according to the value of the who variable would work, but it does not. The frame is always the same.
Can anyone point me in the right direction? Cheers
Different colour speech bubble per character
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: 62
- Joined: Thu Dec 31, 2020 3:37 pm
- Contact:
Re: Different colour speech bubble per character
I'm new to the speech bubble system too, so I may be wrong here, but I think that ATM there's no convenient functionality to change the bubble color or background.RewindTheGame wrote: ↑Mon Mar 25, 2024 9:20 am Sorry to post again, but I'm new to the speech bubble system. I've already make extensive changes to the default say screen to support multiple text boxes on screen at once, different colour and style say windows for each character, etc, but the same sort of thing doesn't seem to work with bubbles.
What I want, as per the title, is to have a different colour speech bubble for each character. I've created differently coloured versions of the bubble and thought bubble png files in the GUI folder, and imagined that just changing the value of bubble.frame and bubble.thoughtframe within the bubble screen so that it points at the relevant files according to the value of the who variable would work, but it does not. The frame is always the same.
Can anyone point me in the right direction? Cheers
Perhaps it's something that should be discussed in "Development of Ren'Py" section.
Right now I can imagine a hack like this:
- Set bubble.properties_callback function, which would take a character ("image tag", like "eileen" or "lucy"), and return a list of modified bubble properties, to substitute "normal" properties.
- Add to the list of "normal" properties, which are
Code: Select all
define bubble.properties = {
"bottom_left" : {
"window_background" : Transform(bubble.frame, xzoom=1, yzoom=1),
"window_bottom_padding" : 27,
},
"bottom_right" : {
"window_background" : Transform(bubble.frame, xzoom=-1, yzoom=1),
"window_bottom_padding" : 27,
},
"top_left" : {
"window_background" : Transform(bubble.frame, xzoom=1, yzoom=-1),
"window_top_padding" : 27,
},
"top_right" : {
"window_background" : Transform(bubble.frame, xzoom=-1, yzoom=-1),
"window_top_padding" : 27,
},
"thought" : {
"window_background" : bubble.thoughtframe,
}
}
Code: Select all
"bottom_left_lucy" : {
"window_background" : Transform(frame_lucy, xzoom=1, yzoom=1),
"window_bottom_padding" : 27,
},
"bottom_right_lucy" : {
"window_background" : Transform(frame_lucy, xzoom=-1, yzoom=1),
"window_bottom_padding" : 27,
},
"top_left_lucy" : {
"window_background" : Transform(frame_lucy, xzoom=1, yzoom=-1),
"window_top_padding" : 27,
},
"top_right_lucy" : {
"window_background" : Transform(frame_lucy, xzoom=-1, yzoom=-1),
"window_top_padding" : 27,
},
"thought_lucy" : {
"window_background" : thoughtframe_lucy,
}
Then the code could be
Code: Select all
init python:
def bub_custom(tag):
possible = [
'_'.join(("bottom_left", tag)),
'_'.join(("bottom_right", tag)),
'_'.join(("top_left", tag)),
'_'.join(("top_right", tag)),
'_'.join(("thought", tag))
]
actual = []
for i in possible:
if i in bubble.properties:
actual.append(i)
if actual:
return actual
return ["bottom_left", "bottom_right", "top_left", "top_right", "thought"]
define bubble.properties_callback = bub_custom
Therefore if you only want to use "bottom left" bubble for "lucy", you can set "bubble.properties" like this (adding one custom property for "lucy" bubbles):
Code: Select all
define bubble.properties = {
"bottom_left" : {
"window_background" : Transform(bubble.frame, xzoom=1, yzoom=1),
"window_bottom_padding" : 27,
},
"bottom_right" : {
"window_background" : Transform(bubble.frame, xzoom=-1, yzoom=1),
"window_bottom_padding" : 27,
},
"top_left" : {
"window_background" : Transform(bubble.frame, xzoom=1, yzoom=-1),
"window_top_padding" : 27,
},
"top_right" : {
"window_background" : Transform(bubble.frame, xzoom=-1, yzoom=-1),
"window_top_padding" : 27,
},
"thought" : {
"window_background" : bubble.thoughtframe,
}
"bottom_left_lucy" : {
"window_background" : Frame("gui/bubble_lucy.png", 55, 55, 55, 95),
"window_bottom_padding" : 27,
},
}
Re: Different colour speech bubble per character
PS. To only change the bubble color, it's possible to use the same .png and add "matrixcolor" property to Transform:
where tint is a color code, e.g. "#FAA" and the like.
Code: Select all
...Transform(bubble.frame, xzoom=1, yzoom=1, matrixcolor=TintMatrix(tint))
-
- Regular
- Posts: 62
- Joined: Thu Dec 31, 2020 3:37 pm
- Contact:
Re: Different colour speech bubble per character
Wow, these are great answers - thank you. Something to play with tomorrow
Jeffster: Quite a lot of my program is "hacks" to make things happen. Luckily I've been programming for decades so making things work is my middle name (lol), but it would definitely be nice to have these features available rather than having to hammer them in...
Jeffster: Quite a lot of my program is "hacks" to make things happen. Luckily I've been programming for decades so making things work is my middle name (lol), but it would definitely be nice to have these features available rather than having to hammer them in...
Re: Different colour speech bubble per character
Understandable...RewindTheGame wrote: ↑Mon Mar 25, 2024 3:32 pm Wow, these are great answers - thank you. Something to play with tomorrow
Jeffster: Quite a lot of my program is "hacks" to make things happen. Luckily I've been programming for decades so making things work is my middle name (lol), but it would definitely be nice to have these features available rather than having to hammer them in...
Here's a script that should make coloring bubbles easier (using matrixcolor)
viewtopic.php?t=68099
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot]