+1 vote

Hi, I'd like a way to have the overall size of the sprite object increase without actually changing the sprite itself. So for a square sprite, for example the default Godot icon, there would be some empty space between the confines of the sprite object but the texture itself is still the same size.

This will allow me to use shaders to draw an outline around the texture without parts of the outline being cut off, as they only display within the sprites boundaries.

I know I could just edit the image in separate software and reimport it but it would be much more convenient and consistent if I could do it using code within the engine.

If anyone has any advice on how this could be accomplished, or offer alternative ways to create a similar outline effect, this would be greatly appreciated.


asked Jul 2, 2019 in Engine by tewi (16 points)

1 Answer

+1 vote
Best answer

Check out the Godot's Sprite Shaders Demo which has an outline shader.
There are also a bunch on Reddit.

answered Jul 2, 2019 by Dlean Jeans (3,888 points)
selected Jul 2, 2019 by tewi

Thanks, I'll have a poke about

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.