Image button ui.interact() returns nothing. Blank screen.

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
Renpie
Newbie
Posts: 14
Joined: Sat Jul 11, 2015 9:49 am
Contact:

Image button ui.interact() returns nothing. Blank screen.

#1 Post by Renpie » Sat Jul 11, 2015 9:59 am

Hello,
According to this page:
http://www.renpy.org/wiki/renpy/doc/ref ... i.interact

There's that code on bottom, but it doesn't work for some reason with my own code.

Example code:

Code: Select all

$ ui.vbox(xalign=0.5, yalign=0.5)
$ ui.textbutton("Choice 1", clicked=ui.returns(1))
$ ui.textbutton("Choice 2", clicked=ui.returns(2))
$ ui.close()

$ result = ui.interact()
if result == 1:
    "You picked choice 1!"
else:
    "Choice 2 was for you!"
My own code:

Code: Select all

python:
	if slot6[1] > 0:
		ui.frame(xpos=.5875,ypos=.55)
		ui.imagebutton("images/button1.png", "images/button_hover1.png", clicked=ui.returns(6))
	ui.interact()

$ result = ui.interact()
Button is there, but it just vanishes after being clicked. Game gets stuck with blank screen when i try to set results variable, i can go back but can't go past that $ result = ui.interact(). Game does not give any errors.

Anyone know what's going on?
I managed to fix it, you don't need to add "ui.interact()" after button.. looks like i got confused with this one.

Code: Select all

python:
    ui.frame(xalign=.5,yalign=.5)
    ui.imagebutton("button.png", "button_hover.png", clicked=ui.returns(1))
    ui.interact()
    # Tip : You can use the same image twice if you don't want any hover effect.
#
Renpie.

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Image button ui.interact() returns nothing. Blank screen

#2 Post by trooper6 » Sat Jul 11, 2015 11:58 am

If you look at the top of the page you linked, you'll notice that you were looking at the wiki. Which is terribly out of date. The old ui language is no longer preferred. Instead you should be using screen language, which is documented here: http://www.renpy.org/doc/html/screens.html

If you haven't read the modern documentation here, you should: http://www.renpy.org/doc/html/
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

Post Reply

Who is online

Users browsing this forum: No registered users