This excellent answer was provided by Theraot on Stack Overflow:
First of all, in this line:
drawtexture(splashplanet._texture, center)
You would be drawing the texture with the upper left corner on the coordinates of center. If you want to draw the texture with the center on center, you do this:
var texture := splashplanet.texture
var size := texture.getsize()
drawtexture(texture, center - size * 0.5)
Since you are using drawtexture and you want to scale, you can use drawset_transform:
draw_set_transform(Vector2.ZERO, 0.0, Vector2(scale_x, scale_y))
As you can see the third parameter is the scale. The first two parameters are translation and rotation. Once you have set the transform you can do the draw call as usual:
draw_set_transform(Vector2.ZERO, 0.0, Vector2(scale_x, scale_y))
var texture := splash_planet._texture
var size := texture.get_size()
draw_texture(texture, center - size * 0.5)
Calling drawsettransform again (or calling drawsettransform_matrix) will overwrite the previos transform.
Alternatively you can use drawtexturerect:
var texture := splash_planet._texture
var size := texture.get_size() * Vector2(scale_x, scale_y)
var rect := Rect2(center - size * 0.5, size)
draw_texture_rect(texture, rect, false)
In this case we compute the rectangle where to draw the texture. We also specify we don't want to tile it (the false as third argument), so Godot will stretch it.
You might also be interested in drawtexturerect_region, which allows you to draw a rectangular region of the source texture.