Jump to content
Search Community

MOVE and SCALE on the edges and overall

Ray test
Moderator Tag

Recommended Posts

Hi!

 

We are using the paid version of your component on behalf of our client.

We would like to know how to achieve the below case:

 

Q 1. The textField (Transform TextFields too!...) used at the example shown at http://www.greensock.com/transformmanageras3/ shows MOVE and SCALE cursors when mouse is placed on the small-squares/ handlers. When mouse is placed on the box/ edges only MOVE CURSOR is visible. Can we have MOVE and SCALE cursors both throughout the box-edges?

 

 

Q 2. For the textField can we have MOVE CURSOR all over the textfield than on the edges and handles, similar to what we have for the image objects?

 

Thank you in advance.

- Dev Team

Link to comment
Share on other sites

1) Sure, you can customize any of the cursors using the customizeMoveCursor(), customizeScaleCursor(), and customizeRotationCursor() methods. http://greensock.com/as/docs/transform/com/greensock/transform/TransformManager.html#customizeMoveCursor()

 

2) You don't want users to be able to edit the text? If that's the case, I'd recommend just nesting your TextField in a Sprite and then add that Sprite to the TransformManager instead of the TextField. If you don't want the TextField to scale, you could instead just set the associated TransformItem's hasSelectableText property to false, like yourTransformManager.getItem(yourObject).hasSelectableText = false;

Link to comment
Share on other sites

Thank you Jack.

 

for #2: Yes Scaling of the TextField is required.

Using TextField embedded in a Sprite poses a different challenge i.e. on use of SCALE the TextField itself gets squeezed or stretched. Please advice.

Link to comment
Share on other sites

Did you try simply setting the hasSelectableText property to false? (no need to wrap it in a Sprite)

 

Alternatively, you could create your own custom class that extends Sprite and override its "width" and "height" getters/setters with your own functions that get/set the width/height of the TextField that you put inside of it. You could then set the scaleMode of the associated TransformItem to "TransformManager.SCALE_WIDTH_AND_HEIGHT". That way, as the user changes the size, it'll just funnel all that data through the normal width/height getters/setters and you apply that to your TextField. 

 

Good luck!

Link to comment
Share on other sites

thanks once again.

 

For #1 = I should have explained better.... at http://www.greensock.com/transformmanageras3/ when i take mouse on TextField and to the 'middle-bottom small-square box/ handle' SCALE cursor appears. Without mouse-click when i move the mouse slightly below then MOVE cursor also appears.

The same working is expected throughout all the edges of the selection / transform box (attached is an image) can this be achieved? as we can see MOVE icon, can we have SCALE icon also when mouse of shifted a bit the way it happens for  'middle-bottom small-square box/ handle'.

thank you.

post-18094-0-60217900-1390899114_thumb.jpg

Link to comment
Share on other sites

ok, last attempt to explain and then i can conclude on that.

 

As you see at the attachment the mouse is placed on the edge of the selection box, somewhere 30 pix from left (i.e. not at the centre), and MOVE cursor is visible which is desired. Now moving mouse slight up or down can the MOVE cursor be changed to SCALE easily or with some builtin feature then custom coding?

 

thanks

Link to comment
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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...