KineticJS绘图方法有什么区别? [英] What is the difference between KineticJS draw methods?
问题描述
KineticJS方法之间的差别 layer.draw()
, layer.drawScene()
和 layer.drawHit()
?
看看源代码(v4.3.1),l。 3381ff。这些定义在 Kinetic.Container
上。
draw:function ){
this.drawScene();
this.drawHit();
},
drawScene:function(canvas){
// do stuff
},
drawHit:function(){
// do stuff
使用 drawScene
将图形绘制到绘图画布上。
$ b $ <
Kinetic.HitCanvas
。 更新:您可以在其 Github 存储库中找到代码。
draw()
可以在 Node.js ,另外两个 Container.js
请注意,Eric停止使用KineticJS。
What is the difference between KineticJS methods layer.draw()
, layer.drawScene()
and layer.drawHit()
?
Have a look at the source (v4.3.1), l. 3381ff. These are defined on a Kinetic.Container
.
draw: function() {
this.drawScene();
this.drawHit();
},
drawScene: function(canvas) {
// do stuff
},
drawHit: function() {
// do stuff
}
The drawScene
is used to draw the shapes onto the drawing canvas.
The drawHit
(see example) is used to allow to modify the region where mouse events trigger events. This is done internally using a special Kinetic.HitCanvas
.
Update: You can find the code inside their Github repository.
draw()
can be found in Node.js, the other two inside Container.js
Please be aware that Eric discontinued KineticJS.
这篇关于KineticJS绘图方法有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!