I am trying to learn some kinetic.js. I heve some problem with following example:
What does this part actually do:
stage.getDragLayer().beforeDraw(function() {
drawCurves(curveLayer.getCanvas(), layer.quad, layer.bezier);
updateDottedLines(layer);
});
I mean getDragLayer() method and beforeDraw() method.
KineticJS builds a specialized layer that handles drag/drops.
getDragLayer() gets a reference to this layer.
beforeDraw() allows a function to be executed before any drawing related to the drag/drop are started. In this case, drawCurves() and updateDottedLines() are called--these 2 functions are defined in the demo you're learning.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.