Place Items in the Backgrounds and hide after click
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.
- Darim
- Regular
- Posts: 67
- Joined: Sun Jun 21, 2015 4:17 pm
- Organization: Setsuna Ken
- Github: SetsunaKen
- Location: Germany
- Contact:
Place Items in the Backgrounds and hide after click
Hey Guys,
I want to place items in my backgrounds.
So Basically I want to show images in the background and if you click on them the items should disappear/hide. You don't have to collect them so if you go ahead without to click on the Items nothing will happen.
Example:
If click on item1.jpg:
hide item1.jpg
$ secret_item +=1
"You have found Item1."
else
do nothing
Is there a easier way to do it without using imagemaps and hotspots ?
I want to place items in my backgrounds.
So Basically I want to show images in the background and if you click on them the items should disappear/hide. You don't have to collect them so if you go ahead without to click on the Items nothing will happen.
Example:
If click on item1.jpg:
hide item1.jpg
$ secret_item +=1
"You have found Item1."
else
do nothing
Is there a easier way to do it without using imagemaps and hotspots ?
- sashaaero
- Regular
- Posts: 45
- Joined: Mon Jul 13, 2015 6:08 pm
- Projects: Everlasting Cold
- Organization: OverDream Development
- Github: sashaaero
- Skype: sashaaero
- Contact:
Re: Place Items in the Backgrounds and hide after click
EDITED:
You can make it as screen
You can make it as screen
Code: Select all
screen sectet_item:
imagebutton ... action[sectet_items+=1, Hide("secret_item")]
Re: Place Items in the Backgrounds and hide after click
The problem with having multiple items on one screen, and then trying to hide the screen when you click on one... means they're all hidden.
Instead, make a variable and check that if it'll be drawn on the screen.
Here's a quick and very basic example:
Instead, make a variable and check that if it'll be drawn on the screen.
Here's a quick and very basic example:
Code: Select all
init python:
secretitem1 = 0
secretitem2 = 0
label start:
"here's a test"
show screen hideandseek
"and now we see if it works"
"I sure hope it does"
return
screen hideandseek:
if secretitem1 is not "Found":
imagebutton idle "item1.jpg" hover "item1.jpg" pos (.1, .1) action SetVariable("secretitem1", "Found")
if secretitem2 is not "Found":
imagebutton idle "item2.jpg" hover "item2.jpg" pos (.8, .1) action SetVariable("secretitem2", "Found")
- Kia
- Eileen-Class Veteran
- Posts: 1011
- Joined: Fri Aug 01, 2014 7:49 am
- Deviantart: KiaAzad
- Discord: Kia#6810
- Contact:
Re: Place Items in the Backgrounds and hide after click
you can add lots of small screens on your screen simply by showing them
Code: Select all
label start:
"here's a test"
show screen hideandseek
show screen item1
show screen item2
show screen item3
show screen item4
show screen item5
"and now we see if it works"
"I sure hope it does"
returnWho is online
Users browsing this forum: Bing [Bot], Google [Bot]