+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.

Thanks,
tewi

in Engine by (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.

by (4,155 points)
selected by

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.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.