How can i make a dragable object? For example i have draggable objects to choose from. 1, 2and 3. When i drag 1 the the object 1 creates another similar object. Then it can only be dropped at a certain location. If not the object disappears.
Thanks in adance
Something like this?
exactly thanks by the way :)
i got the logic now thanks man your a life saver
can i ask what is the sprite.uid. sprite2.uid, sprite3.uid and the variable picked uid. cant understand those. are those boolean variables that are set to 1 when the user click the object?
thanks for answering
In construct 2, any object created is tag with a Unique ID(UID). I use the variable PickedUID to store the selected sprite(when clicked) so when mouse onButtonReleased, I use PickedUID to get the last selected(Dragging) sprite and destroy if neccessary.
so PickedUID is used to store the unique id of the object currently drag. and this is used so know what action should be done when the left click is released am i right?
thanks dude :)
Yup. No problem.
Develop games in your browser. Powerful, performant & highly capable.
so what if it is not a line but a box instead how do i compare the x and y of a box sprite at the same time?
If you want the object to 'drop' in the box you can use sprite->Check if overlapping object(box), if yes, destroy the sprite.
If you want to check x and y together then just add another condition Sprite Compare X < or > box.x with the Sprite Compare Y