Open osresearch opened 5 years ago
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.
However, I do feel that p5.renderer should have proper documentation which includes its methods just like p5.Element.
Also, I found out that there is no documentation for p5.renderer2D and p5.rendererGL and thinking of implementing the same.
What are your views @lmccart @stalgiag ?
p5._pInst.circle() should work
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.