pixelkind / p5canvas

An interactive preview for writing p5js code in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=garrit.p5canvas
Other
39 stars 4 forks source link

how to access the p5 object ? #3

Closed LBdN closed 6 years ago

LBdN commented 6 years ago

In my code, I use the p5.Vector.add method. but when running the extension, I got a

mysetup(): Cannot read property 'sub' of undefined draw(): Cannot read property 'sub' of undefined

pixelkind commented 6 years ago

Hej, can you please provide me with an example?

I have tested the example from the reference and it works.

var v1 = createVector(40, 50);
var v2 = createVector(20, 30);

ellipse(v1.x, v1.y, 50, 50);
ellipse(v2.x, v2.y, 50, 50);
v1.add(v2);
ellipse(v1.x, v1.y, 50, 50);

Best regards, Garrit

LBdN commented 6 years ago

I mean the static version of the methods like p5.Vector.add and p5.Vector.sub not the sub method on the vector object.

like : let v3 = p5.Vector.add(v1, v2);

Sorry to have been vague.

Cordialement, Lionel Barret,

On Wed, Nov 15, 2017 at 10:53 AM, pixelkind notifications@github.com wrote:

Hej, can you please provide me with an example?

I have tested the example from the reference https://p5js.org/reference/#/p5.Vector and it works.

var v1 = createVector(40, 50);var v2 = createVector(20, 30); ellipse(v1.x, v1.y, 50, 50);ellipse(v2.x, v2.y, 50, 50);v1.add(v2);ellipse(v1.x, v1.y, 50, 50);

Best regards, Garrit

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pixelkind/p5canvas/issues/3#issuecomment-344636111, or mute the thread https://github.com/notifications/unsubscribe-auth/AAId19nKBX5BUtk6AlsR_0q8KZMedFwwks5s2wjvgaJpZM4Qdc5f .

pixelkind commented 6 years ago

Hej Lionel,

good news, this issue is solved in the next release 1.0.6.

Best regards and thanks for helping, Garrit

pixelkind commented 6 years ago

I have just released a new Version. I would be happy to get some feedback from you, if everything works as expected.

LBdN commented 6 years ago

it works fine . thank you.

Cordialement, Lionel Barret,

On Wed, Nov 29, 2017 at 7:45 AM, pixelkind notifications@github.com wrote:

Closed #3 https://github.com/pixelkind/p5canvas/issues/3.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pixelkind/p5canvas/issues/3#event-1363438509, or mute the thread https://github.com/notifications/unsubscribe-auth/AAId1_UIXXnCDuF5g1qSxmgj-53HgUn6ks5s7VHOgaJpZM4Qdc5f .