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.

Newcomers AppGameKit Corner / Visibility of cloned sprites

Author
Message
george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 6th Dec 2017 20:11
Is it possible to have all cloned sprites visible but not the original?
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 6th Dec 2017 20:15
Yes Just use SetSpriteVisible() to hide the original and when you clone it make the clone visible
george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 6th Dec 2017 21:22
First I need to have all the sprites hidden (original and clones) and then I would like to make visible or not only the clones.
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 6th Dec 2017 21:41 Edited at: 6th Dec 2017 21:47
The original and the clones should have unique IDs, so you can set the visibility of any of them individually or in a batch using a for loop.



That snippet shows it being done with objects, but doing the sprites is basically the same thing.

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 6th Dec 2017 23:59
Conjured, if you have the original sprite hidden, there's no need to hide the clones from the start.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 7th Dec 2017 03:10
Quote: " Conjured, if you have the original sprite hidden, there's no need to hide the clones from the start."

lol
I know, but I do it anyway.

That way I can change my mind about the first one.

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 7th Dec 2017 19:13
You are right guys, I'm sorry to bother you with a such a question, since I could test it with a snippet like with this one from Conjured
My code though, which is more complicated, still makes visible the original sprite. I have to find the bug...
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 7th Dec 2017 23:10 Edited at: 7th Dec 2017 23:11
Quote: " I'm sorry to bother you with a such a question, "

NO question is a bother.

We are all here to help each other by learning together.

It's all good.

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 8th Dec 2017 15:41
Quote: "
NO question is a bother."


can u haz gimme da codez?

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 8th Dec 2017 16:29
Quote: "can u haz gimme da codez?"

lol

I gave you a code example above, but you must mean the other code.

Sure thing man, it's right here!

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1

Login to post a reply

Server time is: 2024-11-24 05:02:37
Your offset time is: 2024-11-24 05:02:37