How do i store drags' positions in $ ui.draggroup() ?

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
iichan_lolbot
Veteran
Posts: 206
Joined: Tue Dec 30, 2008 9:18 am
Projects: iichan erogame
Contact:

How do i store drags' positions in $ ui.draggroup() ?

#1 Post by iichan_lolbot »

For example, in code like this:

Code: Select all

label loop:
    scene black
    $ ui.draggroup()
    $ ui.drag(name="test")
    $ ui.window(background=Solid("#a00"),xminimum=300,yminimum=300,xmaximum=300,ymaximum=300)
    $ ui.vbox()
    $ ui.label("test")
    $ ui.button(clicked=test_button)
    $ ui.label("test")
    $ ui.close() # window
    $ ui.close() # draggroup
    $ ui.interact()
    jump loop
Is it possible without using screen language?

As far as I know, draggroup remembers drags' positions with given names, but surely not if draggroup is recreated in loop.

User avatar
PyTom
Ren'Py Creator
Posts: 16093
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:

Re: How do i store drags' positions in $ ui.draggroup() ?

#2 Post by PyTom »

You basically need to either use a screen, or create a global draggroup and add things to it.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: tim640