How to code photoshop transform widgets

BlitzMax Forums/BlitzMax Programming/How to code photoshop transform widgets

Robert Cummings(Posted 2008) [#1]
I'd like to make those funky boxes you can grab the corners of and rotate, or grab the middle of the sides and scale.

Is this possible to do, if so how? I just want them for my editor so I can make a flash style keyframing editor.


Blueapples(Posted 2008) [#2]
This is the basic logic for how to move an object around on the screen. Each handle will have this sort of logic to move it. You can then scale the bound object and other handles based on the new position of the handle. I haven't done any rotation stuff so you're on your own there.

global ref:point

mouseDown:
  ref.x = mouse.x
  ref.y = mouse.y

mouseMove:
  if mouse.isDown:
    handle.x = handle.x + mouse.x - ref.x
    handle.y = handle.y + mouse.y - ref.y
    // Resize the object
    // Move other handles