Image flip in kinetic?

I have an image in my code as defined here

    var imageObj = new Image();
imageObj.onload = function(){
    imageF = new Kinetic.Image({
        x: 0,
        y: 0,
        scale: (100,100),
        image: imageObj,
        name: "fluffy",
imageObj.src = "Flutter_Fluffy_100.png";


And I would like to be able to flip it (horizontally) at a specific running time. I tried changing the source of the image to pre-flipped, but it caused a lot of problems with duplicating the image, resetting the position and a lot of things. Is there a way to flip an image that is created and used this way? Thank!


source to share

1 answer

This is probably what you want:

//imageF.scale.y =-1;
imageF.scale.x =-1;


This is demonstrated here:

It's almost the same with the image:

edit: fixed link



All Articles