Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Deleting an Image, then recreating that image with the same ID = Objects lose their image...

Author
Message
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 4th May 2019 22:35
I am trying to delete an image, but create a new image for the object with the same ID.



Instead of the object(s) picking up the the newly loaded image with the same ID, its just deleting the old image.

Am I missing something here? Why wouldn't this work? I feel like this should work, and perhaps I am doing something wrong somehow.

Thanks for any guidance.

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 4th May 2019 22:51
not sure how your variables are defined but this works



alternatively you could

fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 4th May 2019 23:03
oh just read your problem again
its noted in the help file you shouldn't delete an image that is already
assigned to an object.

instead you need to loadimage(imgID2,"whatever.img")
Setobject Obj,imgID2)
Then you can delete the old image
deleteImage(imgID1)
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 4th May 2019 23:15 Edited at: 4th May 2019 23:15
Ah. bummer. I was hoping to skip a few steps, and not do that, haha.

Thanks for the heads-up, fubarpk!

Login to post a reply

Server time is: 2024-11-22 21:45:07
Your offset time is: 2024-11-22 21:45:07