Change image sprite at runtime

Better would be image? : Image; or image : Image | null = null;

You can also write:
image! : Image;

That tells typescript that youre sure its assigned :smile:

oh ok, I’ll just go with image?

by user 401167615826984963

Then its undefined by default

Aha, so it looks like the code gen was partially stopped because of those errors. After fixing them, I get some weird flipping with the sprites.

by user 401167615826984963

by user 401167615826984963

Using the setTexture method directly still works, but the new method gives me this flipping behavior

by user 401167615826984963

I can’t seem to find ImageReference anywhere

by user 401167615826984963

Ok, Will look at that tomorrow.

Sure, no rush. What time zone are you in?

by user 401167615826984963

Its in the Needle.Engine asmdef (i think)

Good to know - I’ll try not to ping you too late :slightly_smiling_face:

by user 401167615826984963

Thanks, its fine tho :slightly_smiling_face:

The flip bug is fixed :slightly_smiling_face:
20230105-145218_Made_with_Needle_-_Google_Chrome.mp4

The ImageReference type is in Needle.Engine.Common.

Confirmed sprite flipping is fixed, thanks!

by user 401167615826984963