How do check in code whether sprite has a texture?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Fenisto

I set textures through code but I need to check whether a sprite has it set or doesn’t has any. How do I do it?

:bust_in_silhouette: Reply From: kidscancode

You check the sprite’s texture property. If no texture is defined then the value will be null.

Thanks. I guess I could just print it…

Fenisto | 2020-01-19 18:33