0

I have questions please correct me, I dint't find anything about this after some research, You can point me to an answer if one exist. To be specific this is continuation of another post.

After applying a transformation matrix to the container element there is no dragging animation. I figured it out after reading the documentation:

transformMatrix Matrix2D

Inherited from DisplayObject: transformMatrix:318

If set, defines the transformation for this display object, overriding all other transformation properties (x, y, rotation, scale, skew).

Default: null

for dragging I used x and y proprieties of the target object

dragger.on("pressmove", function (evt) {
    evt.currentTarget.x = evt.stageX;
    evt.currentTarget.y = evt.stageY;
    canvasElement.update();
});

so now I think I have to change the matrix values to make dragging animation. Or there is another solution?


Here is the fiddle with the container with transformation matrix.

Community
  • 1
  • 1

1 Answers1

0

Right. If you apply a transformMatrix it overrides the other transformation properties. The most obvious solution, looking at your code is to just not use a matrix, and set the x and y properties.

https://jsfiddle.net/n55jk201/11/

The other option would be to use Matrix2D.translate(), or set tx/ty on the matrix directly:

https://jsfiddle.net/n55jk201/12/

Obviously there's a lot of code cleanup you could do, but hopefully that conveys the general idea.

gskinner
  • 2,478
  • 11
  • 12
  • Thank You @gskinner for explanation and the resolve, this is exactly what I wanted. Now I feel more confident with **easeljs**. --- Also I'll do my best next time on cleaner code ;) – Vadim Costin Sep 10 '15 at 09:39