SpriteLoader - warnings

Issue #59 resolved
Jan D created an issue

i am having issues with loading images from files. I am using StringFormatter, SpriteLoader and ImageSprite setter to set the image based on context. Images are stored inside "Resources" folder. When the image is loaded directly from within resource folder, everything is fine (see DB_No_warning). But when the image is loaded from subfolder in resource folder, i am getting warning "No sprite resource found at path 'SubFolder/'", even thought the image id is set in contexts constructor, so there is no chance, that the context contains null value (see DB_warning).

Comments (6)

  1. Christian Oeing repo owner

    It looks like the sprite is still set, but on the first initialization it doesn't grab the ID from the context and uses instead an empty string. When not in a sub folder this will just use no sprite, but when in a sub folder the sprite loader tries to load a sprite as the string is not empty ("SubFolder/") and of course can't find a sprite at that location.

  2. Christian Oeing repo owner

    Okay, I added a small example (SpriteLoading) where I could reproduce the warning. Indeed, the sprite is correctly set, but the warning appears nonetheless.

    It has to do with the initialization order. Because of another issue I had to delay value change callbacks to the end of the frame, so the StringFormatter first works with an empty value before it gets informed about the value change and updates its value, too.

    This all is done in one frame, so the user might not see any issue, that's why I won't try to fix it for the next version as it may easily break something else. The warning is annoying and I will try to find a way to fix it by changing something in the initialization order, but it doesn't have a big priority.

  3. Log in to comment