KineticJS绘图方法有什么区别? [英] What is the difference between KineticJS draw methods?

查看:133
本文介绍了KineticJS绘图方法有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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 $ < drawHit (请参阅 example )用于允许修改鼠标事件触发事件的区域。这是在内部使用一个特殊的 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆