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.
John "This card has {outlinecolor=#000000}{color=#FFD700}GOLD{/color}{/outlinecolor} rarity."
What I want this to do is display all the text normally, except for the word GOLD which should be displayed in gold with a black outline - the black outline being necessary because the background is yellow and you wouldn't otherwise be able to read the gold text.
When I do this, the outline doesn't appear and I'm led to believe that this is because I need to also tell the text to physically have an outline to colour. However, I can find nothing about how to add an outline to just specific words rather than for all text in the game.
RewindTheGame wrote: ↑Wed May 22, 2024 10:30 am
When I do this, the outline doesn't appear and I'm led to believe that this is because I need to also tell the text to physically have an outline to colour. However, I can find nothing about how to add an outline to just specific words rather than for all text in the game.
You can add transparent outline to dialogue texts by default:
define gui.outlineW = 5 # your default outline width in pixels
style say_dialogue:
outlines [(outlineW, "#0000")]
# Here you see four colour components, 4th being alpha (0 means transparent).
Now all dialogue texts have transparent outlines, and you can recolor any word's outline with
Be aware that adding transparent outline to the text will increase letter spacing.
If you do not want that, then giorgi1111 has the link that can help you (second to last message in that thread)
I found this too https://github.com/AlfredPros/ranim/tree/main/game
show dialogue "Instead of using {font=cmunbtl.ttf}{color=[cyellow]}show{/color} text{/font}, you can \nuse {font=cmunbtl.ttf}{color=[cyellow]}show{/color} dialogue{/font} to simulate a dialogue text!"
pause
show dialogue "It is possible to {outlinecolor=[cgray]}change{/outlinecolor} text outline {outlinecolor=[cbrown]}midsentence{/outlinecolor}!"
Thanks everyone. I've actually changed the way I'm displaying the text now and have gone about this a whole new way, but thanks for the pointers. It'll definitely come in useful later in development. Also, I suppose I could look at the sourcecode for Doki Doki Literature Club for a lot of these things, because that game does a hell of a lot of weird stuff with text display so it's probably a one stop shop for anything unusual...
Ocelot wrote: ↑Thu May 23, 2024 3:50 am
Be aware that adding transparent outline to the text will increase letter spacing.
If you do not want that, then giorgi1111 has the link that can help you (second to last message in that thread)
Cool. But IMHO creating an image to show a word is like killing a mosquito with a bazooka.
Ocelot wrote: ↑Thu May 23, 2024 3:50 am
Be aware that adding transparent outline to the text will increase letter spacing.
If you do not want that, then giorgi1111 has the link that can help you (second to last message in that thread)
Cool. But IMHO creating an image to show a word is like killing a mosquito with a bazooka.