This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Thanks to Justo Delgado - a.k.a mrcdk (https://github.com/mrcdk) - for the function this one is based on. | |
# It can be found here https://github.com/godotengine/godot/issues/31323 | |
# The sprite parameter must be a Sprite node. | |
func create_polygon_from_sprite(sprite): | |
# Get the sprite's texture. | |
var texture = sprite.texture | |
# Get the sprite texture's size. | |
var texture_size = sprite.texture.get_size() | |
# Get the image from the sprite's texture. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shader_type canvas_item; | |
uniform float width; | |
uniform vec4 outline_color : hint_color; | |
void fragment() | |
{ | |
vec2 size = (vec2(width) * TEXTURE_PIXEL_SIZE); | |
vec4 sprite_color = texture(TEXTURE, UV); |