-
Notifications
You must be signed in to change notification settings - Fork 434
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
Allow the immediate use of async images, once loaded #3022
Conversation
This seems like a good change, I'd like to poke around the history and verify that there's no valid reason for this arg to be false in the first place (it's an optional arg which makes it was intentional for some reason) , but it seems like it's a good change. The only issue is that this is gonna conflict with this PR: #2982, and this change may affect how I approach that other PR, so it just needs some consideration |
At least on openfl's side it is |
I have one theory as to why it's false, I fear that if it's this is just a guess, but it's something I would like checked before merging this |
Yes, it works that way. |
I'm unable to reproduce this issue due to the following reasons: <assets path="assets" embed="false" preload="false"/> it can only be used in |
I updated the original post - example is valid for html5. On |
it turns out the part i was missing was |
So this doesn't seem to be the case, in the following example: import flixel.FlxSprite;
class AsyncImageTestState extends flixel.FlxState
{
inline static var PATH = "async-assets/images/haxe.png";
override function create()
{
super.create();
openfl.Assets.loadBitmapData(PATH, true).onComplete(
function drawSprites(_)
{
for (i in 0...3)
{
final sprite = new FlxSprite(10 + 110 * i, 10);
sprite.loadGraphic(PATH, false, 0, 0, true);
add(sprite);
}
// edit the first sprite, see if all change
final bitmap = (cast members[0]:FlxSprite).graphic.bitmap;
bitmap.fillRect(bitmap.rect, 0xFFff0000);
}
);
}
} only the first sprite is modified, meaning |
When I want to use async assets
I get this
because Flixel doesn't use cache when it gets bmd from openfl assets for some reason, I believe it is a bug.
--- update
example is valid for html5