Instance Methodmigueldeicaza.swiftgodot 0.45.0SwiftGodot
setImage(_:)
Replaces the texture’s data with a new Image
. This will re-allocate new memory for the texture.
final func setImage(_ image: Image?)
If you want to update the image, but don’t need to change its parameters (format, size), use update(image:)
instead for better performance.
Other members in extension
Type members
static func createFromImage(Image?
) -> ImageTexture? Creates a new
ImageTexture
and initializes it by allocating and setting the data from anImage
.class var godotClassName: StringName
Instance members
func getFormat(
) -> Image.Format Returns the format of the texture, one of
Image.Format
.func setSizeOverride(size: Vector2i
) Resizes the texture to the specified dimensions.
func update(image: Image?
) Replaces the texture’s data with a new
Image
.