Skip to content

Commit

Permalink
Show a loading texture for Panel Sprite instead of a error texture (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
4ian authored Sep 9, 2024
1 parent b0da0ce commit 852bf78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions newIDE/app/src/ObjectsRendering/PixiResourcesLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ let loadedBitmapFonts = {};
let loadedFontFamilies = {};
let loadedTextures = {};
const invalidTexture = PIXI.Texture.from('res/error48.png');
const loadingTexture = PIXI.Texture.from(
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAAA1BMVEXX19f5cgrAAAAAAXRSTlMz/za5cAAAAApJREFUCNdjQAMAABAAAbSqgB8AAAAASUVORK5CYII='
);
let loadedThreeTextures = {};
let loadedThreeMaterials = {};
let loadedOrLoading3DModelPromises: ResourcePromise<THREE.THREE_ADDONS.GLTF> = {};
Expand Down Expand Up @@ -985,6 +988,10 @@ export default class PixiResourcesLoader {
return invalidTexture;
}

static getLoadingPIXITexture() {
return loadingTexture;
}

/**
* Get the data from a json resource in the IDE.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default class RenderedPanelSpriteInstance extends RenderedInstance {
const panelSprite = gd.asPanelSpriteConfiguration(
this._associatedObjectConfiguration
);
const texture = PixiResourcesLoader.getInvalidPIXITexture();
const texture = PixiResourcesLoader.getLoadingPIXITexture();

this._tiled = panelSprite.isTiled();
var StretchedSprite = !this._tiled ? PIXI.Sprite : PIXI.TilingSprite;
Expand Down

0 comments on commit 852bf78

Please sign in to comment.