0

I want to dragg a object with the red lines as bounderies. (check image below)

I looked for examples but all i can find are square and circualar shapes.

  • i tried a element with css transform rotate attachted to it -> didn't work
  • i tried svg shape -> not supported
  • i tried to make a shape with canvas - didn't work

i ran out of idea's so hope one of you have one

Containment of object in red

SteinB
  • 162
  • 1
  • 11
  • 1
    any possible way you can provide a fiddle or running code snippit – Cayce K Dec 22 '14 at 13:32
  • jQuery draggables interact with elements in the dom, which are laid out rectangularly, if you want to drag shapes that aren't regular dom objects why are you using jQuery draggables? – StuperUser Dec 22 '14 at 13:36
  • Are the shapes dynamic? Could you have transparent rectangular images that represent the shapes and drag them? What have you tried with with canvas? – StuperUser Dec 22 '14 at 13:37
  • @StuperUser yesh, the object i want to drag is a image with transparent background. what i want is to create a scene where i can drag the image around. so the dragged object is a square but the ground/floor is a shape. – SteinB Dec 22 '14 at 13:49
  • You could create a helper to see if a point is inside a given shape (defined as a set of point coordinates), then use that to validate after dragging or bound the area while dragging. – StuperUser Dec 22 '14 at 13:54

0 Answers0