drag-and-drop screen child problem

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
apoto
Newbie
Posts: 22
Joined: Thu Apr 26, 2018 11:32 am
Contact:

drag-and-drop screen child problem

#1 Post by apoto »

I wanted to make a screen that enables you to drag things to a certain position, after you drag the items into the right slot, the plot continues.
https://imgur.com/a/rb97Oa3

https://imgur.com/a/c3qYtp1
this is what i have now

how can I connect the text and the background together? Thanks.

User avatar
apoto
Newbie
Posts: 22
Joined: Thu Apr 26, 2018 11:32 am
Contact:

Re: drag-and-drop screen child problem

#2 Post by apoto »

here's the code...
I don't really know how to write python, so I used the official document for now

Code: Select all

init python:

    def detective_dragged(drags, drop):

        if not drop:
            return

        store.detective = drags[0].drag_name
        store.city = drop.drag_name

        return True



Code: Select all

draggroup:

        # 我们的侦探。
        drag:
            drag_name "放下绳结"
            #child
            child  "how_select_hover"
            droppable False
            dragged detective_dragged
            xpos 500 ypos 50
        drag:
            drag_name "Zack"
            child "how_select_hover"
            droppable False
            dragged detective_dragged
            xpos 500 ypos 175





        # 他们可以去的城市。
        drag:
            drag_name "1"
            child "how_select_idle"
            draggable False
            xpos 50 ypos 50
        drag:
            drag_name "2"
            draggable False
            child "how_select_idle"
            xpos 50 ypos 175
        drag:
            drag_name "3"
            child "how_select_idle"
            draggable False
            xpos 50 ypos 300
        drag:
            drag_name "4"
            draggable False
            child "how_select_idle"
            xpos 50 ypos 425
        drag:
            drag_name "5"
            draggable False
            child "how_select_idle"
            xpos 50 ypos 550

User avatar
gas
Miko-Class Veteran
Posts: 842
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: drag-and-drop screen child problem

#3 Post by gas »

Two solutions.
One is to draw buttons with text on it already (not translable and not programmatical, but easier).
The other is to use as CHILD a frame displayable, that use that button as image and contain the text. Complex, and i dunno from where you retrieve the text, so no code for the moment.
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.

10 ? "RENPY"
20 GOTO 10

RUN

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot]