SpriteLoader - warnings
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)
-
repo owner -
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.
-
repo owner - marked as minor
-
repo owner This is fixed by the commit a5257cfb3e7fb2fda54e962c865f8f304b2a0643 which was an issue reported in the forum. This makes sure that a binding is not updated with a default value when it is still uninitialized.
-
repo owner - changed status to resolved
-
repo owner - removed milestone
Removing milestone: 1.0.11 (automated comment)
- Log in to comment
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.