Tuesday, 15 September 2015

javascript - set a KineticJS image's offset without moving -



javascript - set a KineticJS image's offset without moving -

is possible set objects offset kineticjs doesn't move?

//this moves img.offsetx(100); //this moves img.offset({x:100,y:0};

ive tried;

img.setoffset({x:100,y:100});

but doesnt seem anything?

i know can set offset when create image as;

var newimg = new kinetic.image({ x: x, y: y, image: imgobject, name: 'image', offset: {x:offx, y:offy} })

position = translate + offset. translatex = x - offsetx. translatey = y - offsety. so, if want create effect of object not appearing moved (though, numbers, has), need add together offset attributes x , y.

javascript kineticjs

No comments:

Post a Comment