Passing a Data URI to Texture constructor hangs Loader (and isLoaded() never returns true)
See original GitHub issueIf I’m reading the Texture
constructor correctly, it should be able to handle Data URI as path
. However, this hangs the loader forever.
export const Images: { [key: string]: ex.Texture } = {
failure: new ex.Texture(
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwAAADcCAYAAAAbWs+BAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gIUARQAHY8+4wAAApBJREFUeNrt3cFqAjEUhlEjvv8rXz
),
};
const allResources = { ...Images };
export const loader = new ex.Loader();
loader.suppressPlayButton = true;
for (const res in allResources) {
loader.addResource(allResources[res]);
}
game.start(loader).then(function () { /* */ }
Invoking .load()
on a Texture
object that was constructed with a Data URI never returns true
for .isLoaded()
.
One thing that catches my attention in Texture
’s constructor is that it appears that:
this._isLoaded = true;
…is called for path
that is not a Data URI, but it is never called for a path
that is a Data URI. See https://github.com/excaliburjs/Excalibur/blob/57e03f4d/src/engine/Resources/Texture.ts#L73
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Safari Technology Preview Release Notes - Apple Developer
Note: Shared Tab Groups and syncing for Tab Groups, Website Settings, and Web Extensions are not enabled in this release. Web Inspector. Elements...
Read more >Texture | Babylon.js Documentation
This represents a texture in babylon. It can be easily loaded from a network, base64 or html input. [API]
Read more >Activity | Android Developers
When an activity exits, it can call setResult(int) to return data back to its parent. It must always supply a result code, which...
Read more >CUDA C++ Programming Guide - NVIDIA Documentation Center
In GPUs with compute capability 9.0, all the thread blocks in the cluster are guaranteed to be co-scheduled on a single GPU Processing...
Read more >FeatureLayer | API Reference - ArcGIS Developers
Non-spatial layer is a table which does not have a spatial column representing geographic features. Creating a FeatureLayer. FeatureLayers may be created in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think it’s there: https://github.com/excaliburjs/Excalibur/blob/master/src/engine/Resources/Texture.ts#L64
Awesome.