About dragging HELP!!!

sky_ssrsky_ssr Member Posts: 58
edited November -1 in Working with GS (Mac)
How to drag and have limitations, like when its the end of the picture, you cant drag left anymore,

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    just put walls around your scene and make them none moveable, and have the collide behavior with the wall in your actor

    cheers
  • MotherHooseMotherHoose Member Posts: 2,456
    John & I practice different ways to skin this cat...and they both work just fine!

    ===
    in your drag-able actor after the constrain to touch Rule...

    Create a rule
    when self.Position.X < game.Display Size.Width - game.Display Size.Width + (self.Size.Width /2)
    --constrainAttribute self.Position.X To: game.Display Size.Width - game.Display Size.Width + (self.Size.Width /2)

    Explanation: Display Size.Width - Display Size.Width = 0 (X coordinate) and that is Left side of screenDisplay.

    Create a rule for the Right side of screenDisplay boundary
    when self.Position.X > game.Display Size.Width -(self.Size.Width /2)
    --constrainAttribute self.Position.X To: game.Display Size.Width -(self.Size.Width /2)

    Create rules for the Top of screenDisplay boundary this is the Display Size.Height
    and for the Bottom of screenDisplay boundary this is the Display Size.Height - Display Size.Height
    using (self.Size.Height/2)

    ==
    the Display Size Width & Height are in computer memory; as are the X & Y and width & height of actor...this way seems more efficient to me...

    MH
Sign In or Register to comment.