Dragging

Agustin, I see that we have a “dragging” cursor. So we can drag patches? Is this dragging only for slides or modules? Can please give me a clue as to how this is done?
I have puzzle items that I want to drag around on the lid of a box. I know that I could just have each item go into inventory and then be gotten out of inventory for use, but with several “pieces” this seems cumbersome.
Thanks.

Oh no, the drag cursor is used for a camera movement. There’s no support for dragging patches now, but eventually we can implement it.

Oh, okay, thanks. Agustin.

Edit: Okay, dumb questions time… :stuck_out_tongue:

You mentioned earlier that you could use a move() to move overlays. I’m guessing that you meant that the entire overlay and all of its elements could be moved around the screen. Can you cause an image or button on an overlay to move across the face of the overlay from position x,y to another point of coordinates? Would it look as though it was being dragged across the screen? Or is the only way to do it currently by using two spots with one fading out as the other fades in? (I’m trying not to ask the impossible of RF2 when coming up with puzzles. :wink: )

You can move an overlay like that, which would automatically reposition all the elements contained within. But to achieve a smooth movement you would have to do a loop where you reposition the layer one pixel at a time. This is what I did with the open/close movement of the journal.

It’s nothing like dragging, though. The user won’t have any sort of control during the movement…

Okay, I’ll pass this info along. Thanks, Agustin.

Agustin, in a spot, can I attach an image to the spot within a function on the spot? Right now, I’m using one spot for the image and disabling it, then enabling that spot with a function on a second spot of the same coordinates.

Like this –

[code]
–the keypad key - no image
LudillePad_13 = SSCryo1:addSpot( Spot(SOUTH, {951, 1811, 1017, 1811, 1017, 1887, 951, 1887}) )
LudillePad_13:attach(FUNCTION,
function()
Ludille_13:enable() --highlight the key when pushed
play(“cryo_keypad.ogg”)
end)

–image of highlighted key - disabled until the keypad is pressed
Ludille_13 = SSCryo1:addSpot( Spot(SOUTH, {951, 1811, 1017, 1811, 1017, 1887, 951, 1887}) )
Ludille_13:attach(IMAGE, “L-13.png”)
Ludille_13:disable() [/code]

These puzzles are lengthy and it would save a lot of lines of code, if I could enable an image from within a single spot. Hopefully this is possible and I’m just doing it incorrectly.

I’m not sure I understand very well… you add images with one line (attach) and they’re automatically enabled. The syntax you’re using to disable/enable the spots is correct, except you should create Ludille_13 before LudillePad_13, since the latter references the former.

Is that what you meant?

What I want to do is combine the above two spots into one spot, since they both occupy the exact same coordinates. Something like this –

--add the highlighted image when the key is pushed LudillePad_13 = SSCryo1:addSpot( Spot(SOUTH, {951, 1811, 1017, 1811, 1017, 1887, 951, 1887}) ) LudillePad_13:attach(FUNCTION, function() attach(IMAGE, "L-13.png") --add the image of the highlighted key when pushed play("cryo_keypad.ogg") end)

Right… I know what you mean now. You can do:

self:attach(IMAGE, "L-13.png") --add the image of the highlighted key when pushed

BUT the image won’t be loaded automatically. That’s something I have to implement, a sort of refresh command or similar. So the above code will work but the image won’t show until you re-enter the node. Sorry :-/

Still, give it a try. If it works, I will implement the refresh eventually.