Scripts / Reference a Sprite in another variable

Author
Message
Nathan38
13
Years of Service
User Offline
Joined: 13th Feb 2011
Location:
Posted: 2nd Feb 2018 22:37
Hi all,
I am looking for some assistance with Sprites

Say I have this sprite:



I am assigning this sprite the name of "milk_sprite", right?

I want to know if I can manipulate this sprite later, through another variable, like this:



Is something like this possible?
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 2nd Feb 2018 22:49
Yes but without the quotes, i.e. item_image = milk_sprite

You can also do:

milk_sprite = CreateSprite( LoadImage ( "scriptbank\\xanthir\\Milk.bmp" ) )

That way the storage used by LoadImage is freed straight away.



Been there, done that, got all the T-Shirts!
PM
Nathan38
13
Years of Service
User Offline
Joined: 13th Feb 2011
Location:
Posted: 7th Feb 2018 00:34
Thanks for response Amen, it works great!

I have a request (and feel free to say no), but would you mind if i pm'd you a script i'm having trouble with? I can't find any examples of similar things and I'm really struggling!

Login to post a reply

Server time is: 2024-04-26 11:27:06
Your offset time is: 2024-04-26 11:27:06