0

Error I am getting is (In the console):

Uncaught TypeError: Object #<Object> has no method '_initText'      kinetic.js:52

I am trying to add simple Text to my canvas (using Kinetic.Js) like this

var simpleText = Kinetic.Text();

As soon as I commment this line out, there is no error or warning. But when I keep this I get the error.


Judging by the fact that it's Text with capital T it is a constructor function and you have to new it up.

var simpleText = new Kinect.Text()

Check out this tutorial for example usage. More about JavaScript naming conventions here.

4

1 回答 1

1

从它是带有大写 T 的 Text 的事实来看,它是一个构造函数,你必须更新它。

var simpleText = new Kinect.Text()

查看教程以了解示例用法。更多关于 JavaScript 命名约定的信息在这里

于 2013-03-21T08:46:09.830 回答