Drag and Drop horizontal boundaries

violaterr

  • Posts: 14
How can I modify this behavior so that I can only drag the actor a certain distance left or right. I want to set boundaries so that:

when the X of the actor is lined up with the left of the screen u can now longer drag any further right
when the right side of the actor (the width I suppose) hits the right side of the screen I can no longer drag left

The actor is wider than the screen  and spawns at different random x coordinates within certain constraints.

Here is the behavior I'm working with, any help is appreciated:




LIBERADO

  • *
  • Posts: 2720
Simply, add this code at the end of your behavior:
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

violaterr

  • Posts: 14
Liberado, you've done it again. Where would this forum be without you?

It worked perfectly, thank you so much.

Innes

  • *
  • Posts: 1960
Liberado, you've done it again. Where would this forum be without you?

Hence  :D ...

Visit www.TheStencylBook.com - the only published book for learning Stencyl.

I mean...he's no Master but he gets things done. :P

Innes

  • *
  • Posts: 1960
... he gets things done. :P

He sure does; the quality and speed of LIBERADO's responses are astonishing.
Visit www.TheStencylBook.com - the only published book for learning Stencyl.