I was struggling because my artist wanted me to give each character a different namebox and I couldn't find a tutorial that worked for me (most of them were using the old UI/ styles code). After a bit of googling and creative thinking, I present to you:
A foolproof way to give characters different nameboxes!
In screens.rpy, change this line in the style namebox code:
Code: Select all
#background Frame("gui/namebox.png", gui.namebox_borders, tile=gui.namebox_tile, xalign=gui.name_xalign)
Code: Select all
background ConditionSwitch(
"_last_say_who == 'a'", Frame("gui/namebox_artist.png", gui.namebox_borders, tile=gui.namebox_tile, xalign=gui.name_xalign),
"_last_say_who == 'n'", Frame("gui/namebox_inneryou.png", gui.namebox_borders, tile=gui.namebox_tile, xalign=gui.name_xalign),
"_last_say_who == 'an'", Frame("gui/namebox_animator.png", gui.namebox_borders, tile=gui.namebox_tile, xalign=gui.name_xalign),
)
After Frame( you write the name of the namebox image you want to use.
Note that all of the namebox images used should be the same size and positioned identically or there will be problems with the image alignment. You can adjust it by playing around with this code but the easiest way is to have the images match.
This has worked for me so far, but please let me know if you run into any problems using this method - it hasn't been thoroughly tested yet.