Closed zuoRambo closed 9 years ago
Works nice for me: http://jsbin.com/bipoke/13/edit?js,output
thank you a lot, @lavrton man, even your code is not none of the bussiness about the 'Image drag funciton' . i have find the solution how to fix my bug!do you have an api documention about kinetic js?
var image = new Kinetic.Image(conf);
image.on('mousedown',function(e){
t.isImageDrage = true;
this.dragBoundFunc(function(pos){
if(e.evt.altKey)
return {
x: pos.x,
y: this.getAbsolutePosition().y,
}
else if(e.evt.shiftKey)
return {
x: this.getAbsolutePosition().x,
y: pos.y,
}
else
return pos;
});
});
thanks again for your help!
Now sure how long it will be available here: http://lavrton.github.io/KineticJS/api/ But I suggest you to switch to KineticJS fork: http://konvajs.github.io/
@lavrton wow! the api is amazing! how do you make it? jsDOC_toolkit?
@zuoRambo right. + template https://github.com/terryweiss/docstrap
my kinetic version is '5.1.0'i find the follow code from src file kinetic-v5.1.0.js
and there is my function code, i want to achieve the goal to press 'shift' or 'alt' key to control the direction
but unlucky! the code didn't work well! could you help me? where can i find the api wiki about the kinetic?