-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dead asset elimination? #1768
Comments
Why use |
Only because I thought that was The Way It Is Done In HaxeFlixel. If I may pass the question back to you, why use Also, none of the following worked (all just gave a placeholder): var sprite = new FlxSprite().loadGraphic("dolphin__png");
var sprite = new FlxSprite().loadGraphic("images/dolphin__png");
var sprite = new FlxSprite().loadGraphic("assets/images/dolphin__png"); ...oops. Of course, the filename has a dot, not two underscores, so this works: var sprite = new FlxSprite().loadGraphic("assets/images/dolphin.png"); |
Reflection has two issues I know of:
|
So, using Reflection on |
If you're using loadGraphic function with OpenFL's regular Assets class, I think you just give the actual asset name, so just |
I see. Thanks both of you for your help, I understand much better now. |
Good luck! |
Thanks :) |
Code snippet reproducing the issue:
Using this dolphin.png
Observed behavior: Sprite placeholder appears instead of dolphin.png image, despite the fact that dolphin.png was correctly copied into the bin/assets/images/ folder (clean build.)
Expected behavior: That the requested image would appear, like it does in flash debug/release targets.
I tried to make a workaround, thinking if I loaded all my assets the normal way, then those that I accessed with Reflect would be available afterwards. Not so. The following code:
...correctly loads dolphin.png the first time, but the second time gives a placeholder still.
The text was updated successfully, but these errors were encountered: