question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Passing a Data URI to Texture constructor hangs Loader (and isLoaded() never returns true)

See original GitHub issue

If 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:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

0reactions
thomergilcommented, May 14, 2020

Awesome.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found