Skip to content

Commit 73ff886

Browse files
committed
add example code
1 parent 0b9d59a commit 73ff886

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

py5_docs/Reference/api_en/Py5Graphics_is3d.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,19 @@ is3d() -> bool
1111
Boolean value reflecting if the Py5Graphics object is or is not a 3D renderer.
1212

1313
This will be `True` if the renderer is a 3D renderer such as `P3D`.
14+
15+
@@ example
16+
def setup():
17+
py5.size(200, 200)
18+
g = py5.get_graphics()
19+
20+
# prints False
21+
print(g.is3d())
22+
23+
@@ example
24+
def setup():
25+
py5.size(200, 200, py5.P3D)
26+
g = py5.get_graphics()
27+
28+
# prints True
29+
print(g.is3d())

0 commit comments

Comments
 (0)