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.


Your struct has almost certainly been padded to preserve the alignment of its content. This means that it will not be 37 bytes, and that mismatch causes the reading to go out of sync. Looking at the way each string is losing 3 characters, it seems that it has been padded to 40 bytes.

As the padding is likely to be between the string and the integers, not even the first record reads correctly.

In this case I would recommend not attempting to read your data as a binary blob, and stick to reading individual fields. It's far more robust, especially if you even want to alter your structure.

4

1 に答える 1

1

大文字の T を持つテキストであるという事実から判断すると、これはコンストラクター関数であり、新しいものにする必要があります。

var simpleText = new Kinect.Text()

使用例については、このチュートリアルをご覧ください。JavaScript 命名規則の詳細については、こちらを参照してください。

于 2013-03-21T08:46:09.830 に答える