Python class and Drag fonction

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
sculpteur
Regular
Posts: 91
Joined: Fri Nov 17, 2017 6:40 pm
Contact:

Python class and Drag fonction

#1 Post by sculpteur » Fri Dec 15, 2017 10:05 am

Hi,

I don't know if its doable because its seems really complicated to me and I have no idea where I should start.

But I want to drag an image button (or a simple image if its necessary) from my inventory screen (which is linked to a Python inventory system).

I want to be able to drag it everywhere on the screen and put it in a container (a square) which is somewhere on the screen (with coordinates).
But, if its not inside this square when the player release it, the image button should come back directly to his original spot.
If its in the square, the image button (inventory icon) will stick inside the square and disappearform the inventory menu.
I only know how to do the second part (make it disappear from the inventory screen thanks to the item.drop fonction).
But I don't know how to make the first part (with the square coordinate condition).

If you have any idea let me know it will be great :)

sculpteur
Regular
Posts: 91
Joined: Fri Nov 17, 2017 6:40 pm
Contact:

Re: Python class and Drag fonction

#2 Post by sculpteur » Fri Dec 15, 2017 1:28 pm

Nevermind I find and other way to do what i was trying to do.

I've use an other sub class on the model of my inventory class and I called it container.
And I just had to play with item_use and append / remove fonction to do it.

I give up to use the drag fonction in all that mess, it was to luxuous for me anyway :)

Post Reply

Who is online

Users browsing this forum: Chandrakanta