Page 2 of 2

Re: Load a sprite created at runtime

Posted: Fri Apr 02, 2021 3:28 pm
by Joel
Hi there,

Just to clarify, when you make the changes you've shown below, and then apply the update I spoke of, it will resolve your issue. If you private message me your invoice number I can send this over.

All the best,
Joel

Re: Load a sprite created at runtime

Posted: Fri Apr 02, 2021 4:13 pm
by robotSmith
Ah, I see. I thought by you meant that the Sprite would work but just the pivot was wrong (and the Sprite would still show up). Okay, sent you the invoice number.

Re: Load a sprite created at runtime

Posted: Sat Apr 03, 2021 12:40 am
by robotSmith
Thanks a lot Joel! It's working great!

Let me tell you what I did:

- I upgraded Easy Save 3 with the new package you sent (appreciate it!)
- When the player hits Save I'm iterating through the Dictionary that holds the object that holds the Sprite (not ideal to iterate a Dictionary but it's fairly small)
- I'm saving the Sprite, and then the Texture2D from the Sprite in this loop
- I'm saving the Dictionary
- When the player hits Load, I load the Dictionary (which should have the new items now, but the Sprites won't work)
- I iterate through the Dictionary to load dynamic Texture2D and then the Sprites
- I reload the Dictionary (and now the Sprites work)

A bit of an awkward process, but I like that I only have to do it in one place and it's so far working fine!

Fully appreciate your help!

Re: Load a sprite created at runtime

Posted: Sat Apr 03, 2021 7:27 am
by Joel
Glad that's all working for you now, let me know if you run into any other issues :)

All the best,
Joel