Skip to content

Commit

Permalink
add quads:clear() method
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmaclarty committed Apr 5, 2020
1 parent dca728b commit cb67cca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2589,6 +2589,7 @@ <h3 id="am.quads" class="func-def">am.quads(n, spec [, usage])</h3>
<li>a view containing the values for the elements As with the <a href="#view:set"><code>view:set</code></a> method, if the attribute is a vector, a table of numbers is also accepted. The quad number (starting at 1) is returned.</li>
</ul></li>
<li><code>remove_quad(n [,count])</code>: Removes <code>count</code> quads starting with the <code>n</code>th. <code>count</code> is 1 if omitted.</li>
<li><code>clear()</code>: Removes all quads.</li>
<li>Additionally methods are created for each attribute of the form <code>quad_&lt;attribute name&gt;</code> that can be used to update the value of a quad attribute. The signature of the method is: <code>quad_attr(n, values)</code> where <code>n</code> is the quad number and <code>values</code> has the same meaning as in the <code>add_quad</code> method.</li>
</ul>
<p>Default tag: <code>&quot;quads&quot;</code>.</p>
Expand Down
1 change: 1 addition & 0 deletions doc/scene_nodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,7 @@ Methods:
The quad number (starting at 1) is returned.
- `remove_quad(n [,count])`: Removes `count` quads starting with the `n`th.
`count` is 1 if omitted.
- `clear()`: Removes all quads.
- Additionally methods are created for each attribute
of the form `quad_<attribute name>` that can be
used to update the value of a quad attribute.
Expand Down
4 changes: 4 additions & 0 deletions lua/shapes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ function am.quads(capacity, spec, usage)
function bind_node:get_num_quads()
return n
end
function bind_node:clear()
n = 0
draw_node.count = 0
end
bind_node:tag"quads"
return bind_node
end
Expand Down

0 comments on commit cb67cca

Please sign in to comment.