adding a colored border around an image

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.
Post Reply
Message
Author
arlj11
Regular
Posts: 28
Joined: Mon Jan 06, 2020 12:30 pm
Projects: 4Wins
Deviantart: arlj11
Github: arlj11
Contact:

adding a colored border around an image

#1 Post by arlj11 » Wed Feb 17, 2021 12:34 pm

I'm adding side images to my game. I want a colored border around each image using the character's defined color. I would prefer to not have to add it to each image.

I think I know where to add the code in the say screen.


What is the character color variable?

Can frames or borders support colors? If so, how do I add it to an image?

User avatar
zmook
Veteran
Posts: 421
Joined: Wed Aug 26, 2020 6:44 pm
Contact:

Re: adding a colored border around an image

#2 Post by zmook » Wed Feb 17, 2021 2:19 pm

The character color is unfortunately not available in the say screen -- see this response for a way to work around that: viewtopic.php?f=8&t=61350#p539466

Here is a tutorial for creating a colored frame around the character's say screen -- you could use the same ideas to add the frame around the side image instead. You'll have to give the image an id so that you can style it specifically.

You should be able to use a single generic frame background image and set its color dynamically with a TintMatrix.

Does that help? I can try to find time later to write out sample code if necessary.
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM

arlj11
Regular
Posts: 28
Joined: Mon Jan 06, 2020 12:30 pm
Projects: 4Wins
Deviantart: arlj11
Github: arlj11
Contact:

Re: adding a colored border around an image

#3 Post by arlj11 » Wed Feb 17, 2021 4:00 pm

It helps a lot.

I don't see the link to the tutorial.

A sample would be good please.

User avatar
zmook
Veteran
Posts: 421
Joined: Wed Aug 26, 2020 6:44 pm
Contact:

Re: adding a colored border around an image

#4 Post by zmook » Wed Feb 17, 2021 7:00 pm

Oops, here's the frame border tutorial. https://www.renpy.org/wiki/renpy/doc/co ... ing_frames
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM

Post Reply

Who is online

Users browsing this forum: Bing [Bot]