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
Eileen-Class Veteran
Posts: 1039
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

get a drag's position?

#1 Post by Kia »

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
Miko-Class Veteran
Posts: 700
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: get a drag's position?

#2 Post by Andredron »

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

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

Re: get a drag's position?

#3 Post by Kia »

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
Miko-Class Veteran
Posts: 700
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: get a drag's position?

#4 Post by Andredron »

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

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]