<%=item.name%><% if (item.isMethod) { %>()<% } %>

<% if (item.example) { %>

Example

Examples for <%=item.name%>
<%= item.example %>
<% } %>

Description

<% if (item.deprecated) { %>

Deprecated: <%=item.name%><% if (item.isMethod) { %>()<% } %> is deprecated and will be removed in a future version of p5. <% if (item.deprecationMessage) { %><%=item.deprecationMessage%><% } %>

<% } %> <%= item.description %> <% if (item.extends) { %>

Extends <%=item.extends%>

<% } %> <% if (item.module === 'p5.dom') { %>

This function requires you include the p5.dom library. Add the following into the head of your index.html file:

<script language="javascript" type="text/javascript" src="path/to/p5.dom.js"></script>

<% } %> <% if (item.module === 'p5.sound') { %>

This function requires you include the p5.sound library. Add the following into the head of your index.html file:

<script language="javascript" type="text/javascript" src="path/to/p5.sound.js"></script>

<% } %> <% if (item.constRefs) { %>

Used by: <% var refs = item.constRefs; for (var i = 0; i < refs.length; i ++) { var ref = refs[i]; var name = ref; if (name.substr(0, 3) === 'p5.') { name = name.substr(3); } if (i !== 0) { if (i == refs.length - 1) { %> and <% } else { %>, <% } } %><%= name %>()<% } %>

<% } %>
<% if (isConstructor || !isClass) { %>

Syntax

<% syntaxes.forEach(function(syntax) { %>

<%= syntax %>
<% }) %>

<% if (item.return) { %> <% } %> <% if (item.access) { %> <%= item.access %> <% } %> <% if (item.final) { %> constant <% } %> <% if (item.chainable) { %>

chainable

<% } %> <% if (item.async) { %> async <% } %> <% if (item.params) { %>

Parameters

<% for (var i=0; i <% } %>
<% var p = item.params[i] %> <% if (p.optional) { %> <%=p.name%> <% } else { %> <%=p.name%> <% } %> <%if (p.optdefault) { %>=<%=p.optdefault%><% } %> <% if (p.type) { %> <%=p.type%>: <%=p.description%> <% } %> <% if (p.multiple) {%> multiple <% } %>
<% } %> <% if (item.return) { %>

Returns

<% if (item.return.type) { %>

<%=item.return.type%>: <%= item.return.description %>

<% } %>
<% } %> <% } %>