from

fun from(resolver: () -> Texture2D): Sprite2D

Creates a Sprite2D from the given resolver function that provides an Texture2D.

Return

A new Sprite2D instance.

Parameters

resolver

The function that provides the Texture2D.


fun from(texture: Texture2D): Sprite2D

Creates a Sprite2D from the given texture.

Return

A new Sprite2D instance.

Parameters

texture

The Texture2D to create the sprite from.


fun from(image: Image): Sprite2D

Creates a Sprite2D from the given image.

Return

A new Sprite2D instance.

Parameters

image

The Image to create the sprite from.