Skip to content

Trying to load an image as sprite, got nothing #2356

Answered by eonarheim
salsa2k asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @salsa2k

ex.ImageSource needs to be loaded for it to work properly and display in the ex.Sprite. I'll make an issue to log a warning in the console about how to fix this if an unloaded image is detected, not displaying things is a rough failure mode.

You can either call this.image.load() as needed or create a loader and load up all the resources ahead of time, here is an example of a common pattern we employ

Let me know if this helps!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@eonarheim
Comment options

Answer selected by salsa2k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants