How to drag text? (and other question about drag&drog)

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
abeplaga
Regular
Posts: 35
Joined: Mon Oct 15, 2018 10:09 am
Contact:

How to drag text? (and other question about drag&drog)

#1 Post by abeplaga »

Hi! On a temporal screen I'm trying to drag a image with some text over it. I read the documentation but... I can't know if I'm doing well.

I use the code of the example of this https://www.renpy.org/doc/html/drag_drop.html#examples I created a window with an image and a text but it doesn't work, can't drag... Then I tried to use the original code of the example but it does not work either.

So, is it possible to do it?

The original code of the example:

Code: Select all

screen say:

    drag:
        drag_name "say"
        yalign 1.0
        drag_handle (0, 0, 1.0, 30)

        xalign 0.5

        window id "window":
            # Ensure that the window is smaller than the screen.
            xmaximum 600

            has vbox

            if who:
                text who id "who"

            text what id "what"
In my code I've put an add image and text "text" inside the window instead of the who and what.

And other question about drag and drop... Can I limit the area where you can do drag?

That's it... Thanks for the future help!

User avatar
Kia
Eileen-Class Veteran
Posts: 1040
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: How to drag text? (and other question about drag&drog)

#2 Post by Kia »

pay attention to drag_handle
it's the area that you can click and drag, if you remove it, you can drag the window by clicking anywhere inside of it.
the other possibility is: your window is inside something the same size or smaller. this way when you drag, it can't move a noticeable amount.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]