get a drag's position?

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
Kia
Miko-Class Veteran
Posts: 670
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Skype: KiaAzad
Contact:

get a drag's position?

#1 Post by Kia » Sat Sep 22, 2018 12:59 pm

is there a way to get a drag's position as it moves?
I imagine it's something like _get_pos(dr) but I can't find anything related to it anywhere

Code: Select all

default dr_x = 0
screen resize_frame:
    timer .1 repeat True action SetVariable("dr_x", ???? )
    drag:
        id "dr"
        frame:
            xysize(40,40)

User avatar
Andredron
Veteran
Posts: 207
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: get a drag's position?

#2 Post by Andredron » Sat Sep 22, 2018 1:08 pm

Kia wrote:
Sat Sep 22, 2018 12:59 pm
is there a way to get a drag's position as it moves?
I imagine it's something like _get_pos(dr) but I can't find anything related to it anywhere

Code: Select all

default dr_x = 0
screen resize_frame:
    timer .1 repeat True action SetVariable("dr_x", ???? )
    drag:
        id "dr"
        frame:
            xysize(40,40)
In forum project Spline Editor,

https://vk.com/wall-7553243_30858

And

3d camera
viewtopic.php?f=8&t=29778
I know, I have terrible English
I'm writing a Renpy textbook (in Russian). I would be glad if someone translated into an English or German textbook https://yadi.sk/d/ZX_DonP63USRru Update 22.06.18

User avatar
Kia
Miko-Class Veteran
Posts: 670
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Skype: KiaAzad
Contact:

Re: get a drag's position?

#3 Post by Kia » Sat Sep 22, 2018 2:03 pm

those are a ton of code without one drag object in the screens, isn't there something simpler for this simple need?

User avatar
Andredron
Veteran
Posts: 207
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: get a drag's position?

#4 Post by Andredron » Sun Sep 23, 2018 3:40 am

Kia wrote:
Sat Sep 22, 2018 2:03 pm
those are a ton of code without one drag object in the screens, isn't there something simpler for this simple need?
x, y = renpy.get_mouse_pos()

https://www.renpy.org/doc/html/other.ht ... _mouse_pos
I know, I have terrible English
I'm writing a Renpy textbook (in Russian). I would be glad if someone translated into an English or German textbook https://yadi.sk/d/ZX_DonP63USRru Update 22.06.18

Post Reply

Who is online

Users browsing this forum: No registered users