show(screen), screen not defined

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
Lezalith
Regular
Posts: 82
Joined: Mon Dec 21, 2015 6:45 pm
Contact:

show(screen), screen not defined

#1 Post by Lezalith » Mon Dec 21, 2015 7:04 pm

Hey everyone,
I'm sorry, this is probably a stupid question. I'm trying to program a little thingy with getting away with using as little of code as possible. Variables are mostly what I need, and those are easy to manage in Ren'Py.

Code: Select all

screen study:
    tag mains
    imagemap:
        ground "Teaching.png"
        hotspot (110, 110, 100, 100) hovered Show(Desc) unhovered Hide(Desc) action SetVariable(morning, Skill1) 
This screen involves an image map. When hovered, I would like it to show an image OR text at x1 defined position. Since you cannot do Show(text "Ladida" at x1), I decided to make a screen called Desc and call it with the Show(Desc).

Code: Select all

screen Desc:
    add "skill1describ.png" at x1
I am using "add" because "show" is not valid child of "screen", and "image" cannot have specified position ("at" or "xalign"... are not valid children).
I would be okay with using "text", but that's not the issue.
The issue is, I get error message on line where the hotspot is, saying "name "Desc" is not defined."

It's probably me using the Show() wrong, I am a noob with programing and I failed to search for solutions so far, any ideas?

philat
Eileen-Class Veteran
Posts: 1853
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: show(screen), screen not defined

#2 Post by philat » Mon Dec 21, 2015 7:15 pm

Desc should be a string (=in quotation marks).

User avatar
Lezalith
Regular
Posts: 82
Joined: Mon Dec 21, 2015 6:45 pm
Contact:

Re: show(screen), screen not defined

#3 Post by Lezalith » Mon Dec 21, 2015 7:33 pm

You mean like this?

Code: Select all

screen "Desc":
    add "skill1describ.png" at x1
That gives me "Expected 'word' not found".

philat
Eileen-Class Veteran
Posts: 1853
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: show(screen), screen not defined

#4 Post by philat » Mon Dec 21, 2015 8:24 pm

No, as an argument supplied to Show().

ETA: It sounds like you're looking for tooltips anyway. http://www.renpy.org/doc/html/screen_ac ... l#tooltips

User avatar
Lezalith
Regular
Posts: 82
Joined: Mon Dec 21, 2015 6:45 pm
Contact:

Re: show(screen), screen not defined

#5 Post by Lezalith » Tue Dec 22, 2015 8:37 am

Ah yes, I'm so dumb x)

And thanks for the tooltips, I missed those, will come in handy in the future!

Post Reply

Who is online

Users browsing this forum: Google [Bot], _ticlock_