Uh... If there's something like that in Godot, I don't know. I know however this should be possible using shading language, but I'm no expert at it. But I have a "trick" for you.
Create a sprite, texture it and in it's Material propriety, create a CanvasItemMaterial and set Shading Mode to Light Only, making it invisible.
Next, make a Light2D child, texture it with a white square image that engulfs the sprite, and set its Mode propriety to Mask. The main sprite now is visible as long as the mask is opaque.
Also make the same white square image but with an alpha hole at the center, make an AnimationPlayer with a track that scales the mask till a certain point, then in the main sprite script, put:
extends Sprite
var sprite
var mask
var anim
func _ready():
sprite = get_node(".") #main sprite
mask = get_node("Light2D")
anim = get_node("AnimationPlayer")
set_fixed_process(true)
func _fixed_process(delta):
#create the hole
if Input.is_key_pressed(KEY_SPACE):
var hole = load("res://mask_hole.png") #load the mask with the hole
mask.set_texture(hole) #change the one without the hole for it
anim.play("hole_expand") #plays the animation that scales the mask
In this example a hole will appear in the center of the mask, that'll be scaling up, thus making a hole at the center of the main sprite too.
The problem lies in the fact that the mask can affect other sprites in the same light mask layer, so be sure to change both sprite light mask and the mask item mask to prevent this from affecting undesired sprites.
Although it's probably not what you wanted, it should serve as a placeholder till you find a better method.