Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
artlover

(horizontal or vertical) lockposition ?

Recommended Posts

hi all,

Is it possible to lock only the horizontal(or vertical) position?

 

thanks,

best regards...

Link to post
Share on other sites

You could use event handlers to do something like that. For example, to limit movements to up-and-down (vertical):

 

var item:TransformItem = myManager.getItem(mc);
myManager.addEventListener(TransformEvent.START_INTERACTIVE_MOVE, startMoveHandler);
var startX:Number;
function startMoveHandler(event:TransformEvent):void {
startX = item.x;
}
myManager.addEventListener(TransformEvent.MOVE, moveHandler);
function moveHandler(event:TransformEvent):void {
if (item.x != startX) {
	item.x = startX;
	myManager.updateSelection(false);
}
}

Link to post
Share on other sites

No "snap to grid" functionality is built into the current version of TransformManager, no. But you can certainly build that feature yourself.

Link to post
Share on other sites

To do that is very simple. Just follow the procedure provided by the system, then you should get going with the lock position of the horizontal. I dont really know of the vertical.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×