[SOLVED] Close screen on screen itself

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
User avatar
runs
Regular
Posts: 41
Joined: Mon Nov 28, 2011 12:31 pm
Location: Spain
Contact:

[SOLVED] Close screen on screen itself

#1 Post by runs »

I want an imagebutton showing on screen and when the player click on it, close.


My try:

Code: Select all

screen show_item(_item):
  frame:
    imagebutton idle Transform(_item, zoom=0.3)  xpos 0.72 ypos 0.25 action Hide(show_item())
Is it possible a no screen solution maybe? In the script?
Last edited by runs on Mon Mar 26, 2018 6:43 pm, edited 1 time in total.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Close screen on screen itself

#2 Post by Imperf3kt »

You almost have it. Try it like this:

Code: Select all

screen show_item(_item):
  frame:
    imagebutton idle Transform(_item, zoom=0.3)  xpos 0.72 ypos 0.25 action Hide("show_item")
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
runs
Regular
Posts: 41
Joined: Mon Nov 28, 2011 12:31 pm
Location: Spain
Contact:

Re: Close screen on screen itself

#3 Post by runs »

Cool now I want the item approaching to the player (being bigger).

Image

In the scene a rose appears and also zooming out. Then the player click on it and get it supposedly.

I know is 'linear'. But could I insert that effect in my code?

Code: Select all

transform _show_item():
    linear 2.0 zoom 0.3

screen show_item(_item):
    imagebutton idle ???  xanchor 0.5 xpos 0.5 yanchor 0.5 ypos 0.65 action Hide("show_item")
Please, a bit of help.

User avatar
runs
Regular
Posts: 41
Joined: Mon Nov 28, 2011 12:31 pm
Location: Spain
Contact:

Re: Close screen on screen itself

#4 Post by runs »

Never mind. Finally I solved it:

Code: Select all

transform _show_item:
    linear 1.0 zoom 0.3

screen show_item(_item):
    imagebutton idle _show_item(_item)  xanchor 0.5 xpos 0.5 yanchor 0.5 ypos 0.65 action Hide("show_item")

Post Reply

Who is online

Users browsing this forum: No registered users