简体   繁体   中英

kinetic.js stage.getDragLayer method

I am trying to learn some kinetic.js. I heve some problem with following example:

http://www.html5canvastutorials.com/labs/html5-canvas-modify-curves-with-anchor-points-using-kineticjs/

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM