Issue with Renpy Draggable

swimsoot

Member
Game Developer
Mar 14, 2020
305
683
Hi!
I'm developing a VN called Camp Klondike in Renpy. I have a screen that involves "dragging" photos out of envelopes. My issue is:

My draggable "photo" always jumps right to the bottom of the photo instead of the slow dragged reveal I want.
The photos start offscreen, and are set up to be big enough to be limited to only vertical movement. All other facets of this are working as planned.

Anyone have thoughts on how I can make that sexy reveal?

Thanks!
 

rayminator

Engaged Member
Respected User
Sep 26, 2018
3,041
3,141
it's best to post a code that you already have so we know where you at to give a better way of coding it or for a best answer to give
 
  • Like
Reactions: swimsoot

swimsoot

Member
Game Developer
Mar 14, 2020
305
683
screen kscpagecu1():
add "kscbookcu"
draggroup:
drag:
drag_name "hand"
child "pixy1"
draggable True
droppable True
xalign .5
ypos 400

drag_handle (0,0, 1.0, 1.0)
dragged unit_dragged4, draggedsound4
clicked Jump("kscfun1")
[AND unit_dragged4 is defined like this:]

def unit_dragged4(drags,drop):
if drags:
drags[0].snap(0,0)
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,398
15,311
Before I start, please when you post code, use the [code] and [/code] tags to format it. It will be easier for people to read it.


I haven't really messed much with draggable, but I'm pretty sure that draggable and droppable are incompatible ; the first one designate an item that can be dragged, while the second one design an item that will act as "target".
Therefore, I wonder if it's not the reason why the image immediately fall in place. You start to drag the item, Ren'Py look if it's position match a "target"... and it do since the dragged item is also a target.

Also, it's not the size of the image that will limit its movements. There's a drag_offsreen property, and it's it that will limit them, if set at False.
 

swimsoot

Member
Game Developer
Mar 14, 2020
305
683
Before I start, please when you post code, use the [code] and [/code] tags to format it. It will be easier for people to read it.


I haven't really messed much with draggable, but I'm pretty sure that draggable and droppable are incompatible ; the first one designate an item that can be dragged, while the second one design an item that will act as "target".
Therefore, I wonder if it's not the reason why the image immediately fall in place. You start to drag the item, Ren'Py look if it's position match a "target"... and it do since the dragged item is also a target.

Also, it's not the size of the image that will limit its movements. There's a drag_offsreen property, and it's it that will limit them, if set at False.
Good thought on droppable, although same problem. Hmmm... I can try the offscreen code, but the photo does drag, just not smoothly - as if it jumps right to the end. I can try a smaller draggable, but want it big enough to fill most of the screen. Any other thoughts? If not, thanks so much for your ideas!