Load a sprite created at runtime

Discussion and help for Easy Save 3
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Load a sprite created at runtime

Post 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
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
robotSmith
Posts: 39
Joined: Thu Apr 01, 2021 4:53 pm

Re: Load a sprite created at runtime

Post 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.
robotSmith
Posts: 39
Joined: Thu Apr 01, 2021 4:53 pm

Re: Load a sprite created at runtime

Post 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!
Last edited by robotSmith on Sat Apr 03, 2021 7:19 pm, edited 1 time in total.
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Load a sprite created at runtime

Post by Joel »

Glad that's all working for you now, let me know if you run into any other issues :)

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply