[SOLVED] How to temporarily hide character sprites?
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
[SOLVED] How to temporarily hide character sprites?
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!
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!
Last edited by Dacuna on Wed Jul 22, 2020 12:01 am, edited 1 time in total.
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3636
- Joined: Mon Dec 14, 2015 5:05 am
- Location: Your monitor
- Contact:
Re: How to temporarily hide character sprites?
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.
Its not something I've fiddled with, but the documentation it done other forum members should start you right.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
Re: How to temporarily hide character sprites?
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.
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.
-
TheChatotMaestro
- Regular
- Posts: 91
- Joined: Mon Jul 31, 2017 8:33 am
- Deviantart: LedianWithACamera
- Contact:
Re: How to temporarily hide character sprites?
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.
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3636
- Joined: Mon Dec 14, 2015 5:05 am
- Location: Your monitor
- Contact:
Re: How to temporarily hide character sprites?
While this would work, I would advise against it.TheChatotMaestro wrote: ↑Tue Jul 21, 2020 3:52 pmAt 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.
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.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
Re: How to temporarily hide character sprites?
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!
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!
Who is online
Users browsing this forum: Google [Bot]