Jump to content

Sprite2D scaleX not updated on screen


royibernthal
 Share

Recommended Posts

I'm experiencing a bug that I was not yet able to reproduce in an isolated environment.

I'm using bjs 2.5 alpha.

During the loading of assets I'm creating a ScreenSpaceCanvas2D for the preloader UI in my custom loading screen (shown and hidden via a class implementing ILoadingScreen).

I created a Sprite2D bar from an image texture (image was loaded previously), and I change the scaleX of the bar according to the loading progress.

The bar is not updated accordingly. The scaleX variable is changed properly but visually it looks like it's stuck on scaleX 0 or 1. The values I pass are fine.

The bar Sprite2D is a child of a Group2D. I set the origin of the Sprite2D to (0, 0).

The bug persists even after the loading is ended if I choose for testing purposes to not hide the preloader UI.

I have no idea if this is related to the loading situation or not, I just gave as many details as possible. I tried reproducing scaling a simple Sprite2D on the playground and it worked as expected.

Any idea what might be going on here?

@Nockawa

Link to comment
Share on other sites

1 hour ago, Nockawa said:

Can you test again locally with the version I pushed few hours ago in the official repo? (you have to recompile the source code, the preview file was not updated).

It didn't solve it. There's no need to even recompile the typescript project just replace babylon.js in the lib dir and it should be fine. (since babylon.d.ts is not being compiled anyway)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...