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.
-
Devon Andersson
- Newbie
- Posts: 7
- Joined: Sun Nov 12, 2017 9:10 am
-
Contact:
#1
Post
by Devon Andersson » Thu Nov 01, 2018 11:13 am
I have a custom tooltip build with renpy.displayable that follows the mousecuror.
In this thread ...
viewtopic.php?t=19572#p253634
... I've seen this similar code:
Code: Select all
init python:
class MouseTooltip(renpy.Displayable):
# long and irrelevant class code ...
def MouseEvent():
ui.add(mousetooltip)
config.overlay_functions.append(MouseEvent)
define mousetooltip = MouseTooltip()
I'd like to add the tooltip on every screen automatically. Since ui is considered outdated, what's the replacement for the ui.add()-line?
-
PyTom
- Ren'Py Creator
- Posts: 15893
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
-
Contact:
#2
Post
by PyTom » Thu Nov 01, 2018 11:58 am
It's screens. Screens replace ui functions and overlays.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama •
https://www.patreon.com/renpytom
-
Devon Andersson
- Newbie
- Posts: 7
- Joined: Sun Nov 12, 2017 9:10 am
-
Contact:
#3
Post
by Devon Andersson » Thu Nov 01, 2018 12:59 pm
I see. So I ditched the MouseEvent-function for ...
Code: Select all
screen s_mousetooltip():
zorder 110
add mousetooltip
... and added "show screen s_mousetooltip" in my after_load-label
That works.
Users browsing this forum: Bing [Bot]