You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let p5
function setup() {
p5 = createCanvas(400, 400);
}
function draw() {
p5.background(220);
p5.strokeWeight(10)
p5.stroke(0)
p5.circle(width/2, height/2, 100, 100);
}
results in the error (on the javascript console) that p5.circle is not a function. similar results for noStroke and other methods that are in the documentation. Some methods, like line() and stroke() work, while others like ellipse() are defined but don't seem to produce any output.
let p5
function setup() {
createCanvas(400, 400);
p5 = createGraphics(400,400)
}
function draw() {
p5.background(220);
p5.noStroke()
p5.fill(0)
p5.circle(width/2, height/2, 100, 100);
image(p5, 0, 0)
}
An alternate way to solve it would be if it were possible to create a graphics context from a renderer, although I don't see any methods currently for doing so.
The text was updated successfully, but these errors were encountered:
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already.
@osresearch The p5.renderer has access to only the main graphics and rendering methods.
But, it is extended to p5.renderer2D or p5.rendererGL (depends) and thus have the methods background(), noStroke() and fill(). However, circle() is a method of core/Shape and thus can't be implemented using p5.renderer.
Nature of issue?
Most appropriate sub-area of p5.js?
Which platform were you using when you encountered this?
Details about the bug:
Trying to call some methods on the
p5.Renderer
returned fromcreateCanvas()
doesn't work. For instance:results in the error (on the javascript console) that
p5.circle is not a function
. similar results fornoStroke
and other methods that are in the documentation. Some methods, likeline()
andstroke()
work, while others likeellipse()
are defined but don't seem to produce any output.Feature enhancement details:
All these methods do work for the
p5.Graphics
context returned bycreateGraphics()
, so it would be nice if they were consistent between the graphics and renderer objects.An alternate way to solve it would be if it were possible to create a graphics context from a renderer, although I don't see any methods currently for doing so.
The text was updated successfully, but these errors were encountered: