[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 » Mon Mar 26, 2018 6:07 pm

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: 2602
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Close screen on screen itself

#2 Post by Imperf3kt » Mon Mar 26, 2018 6:22 pm

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.

Todo list:
Actually finish a project

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 » Mon Mar 26, 2018 6:36 pm

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 » Mon Mar 26, 2018 6:43 pm

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: Google [Bot]