Page 1 of 1

[SOLVED] How to temporarily hide character sprites?

Posted: Mon Jul 20, 2020 2:25 am
by Dacuna
Hi everyone,
At a certain point in the game, the player can choose an option to look at his surroundings.
When the option is chosen, their sprite disappears to give the player a full shot of the background.
Unfortunately, when the sprite has to reappear, I have to use the "show" command to put the sprite back in the right place and the right direction.
Simple enough, but it comes with a lot of difficulties. What if there are more characters? What if a character isn't in the scene yet? It's possible with variables, but it gets very confusing very fast.
Is it possible to either save the location and number of sprites on screen for when they reappear, or maybe show a background image over an existing scene and hide it when finished?

Thanks for any help!

Re: How to temporarily hide character sprites?

Posted: Mon Jul 20, 2020 4:27 am
by Imperf3kt
You could hide/show the layer maybe.
Its not something I've fiddled with, but the documentation it done other forum members should start you right.

Re: How to temporarily hide character sprites?

Posted: Mon Jul 20, 2020 8:14 pm
by Dacuna
I've fiddled a bit with layers beforehand, but I haven't come across a solution yet. It seems as though both the background and character sprites are kept on the same "master" layer, so that doesn't seem to help much, unless I put all my sprites on a user-defined layer, which seems like it could carry some difficulties in its own right. I'll try to keep toying around with it, but more help would be appreciated.

Edit: Also, is it just me, or does "hide layer master" do literally nothing? I would expect it would at least hide all background and sprite images on screen.

Re: How to temporarily hide character sprites?

Posted: Tue Jul 21, 2020 3:52 pm
by TheChatotMaestro
At the risk of saying something stupid... Maybe just show a copy of the 'background' image on top of all the sprites? Then you wouldn't have to move them at all. If you faded it in right, and it matched the background, it would look like all the sprites faded out.

Re: How to temporarily hide character sprites?

Posted: Tue Jul 21, 2020 5:45 pm
by Imperf3kt
TheChatotMaestro wrote:
Tue Jul 21, 2020 3:52 pm
At the risk of saying something stupid... Maybe just show a copy of the 'background' image on top of all the sprites? Then you wouldn't have to move them at all. If you faded it in right, and it matched the background, it would look like all the sprites faded out.
While this would work, I would advise against it.
This will negatively impact performance as hiding sprites removes them from ram, but adding a picture over the top only increases ram usage.

After a while, you'll end up with some issues.

Re: How to temporarily hide character sprites?

Posted: Wed Jul 22, 2020 12:00 am
by Dacuna
Yes! It worked!
I actually tried something similar before to no avail, but this time, I created an image in-script of the background image but removed the "bg" tag. If I don't, it'll remove the other background and still be behind the character sprites.
As for performance issues, while I totally agree it's not ideal, I doubt it'll be worth worrying about. I mean, that background image is going to get hidden as soon as the player finishes looking at it. I'm no expert so correct me if I'm wrong, but I doubt one temporary image is going to tax your ram noticeably.
In the meantime, thank you TheChatotMaestro!