{{newin (日本語)|[[0.10.0 (日本語)|0.10.0]]|100|type=関数}}
Discards (trashes) the contents of the screen or active [[Canvas]]. This is a performance optimization function with niche use cases.

If the active Canvas has just been changed and the "replace" [[BlendMode]] is about to be used to draw something which covers the entire screen, calling [[love.graphics.discard]] rather than calling [[love.graphics.clear]] or doing nothing may improve performance on mobile devices.

On some desktop systems this function may do nothing.

{{notice|This function effectively replaces the contents of the screen or active Canvas with garbage. Most [[BlendMode]]s, including the default "alpha" blend mode, blend what's drawn with the contents of the screen - which would cause unexpected glitches if this function is used inappropriately.}}

== 関数 ==
=== 概要 ===
<source lang="lua">
love.graphics.discard( discardcolor, discardstencil )
</source>
=== 引数 ===
{{param (日本語)|boolean|discardcolor (true)|Whether to discard the texture(s) of the active Canvas(es) (the contents of the screen if no Canvas is active.)}}
{{param (日本語)|boolean|discardstencil (true)|Whether to discard the contents of the [[love.graphics.stencil|stencil buffer]] of the screen / active Canvas.}}
=== 返値 ===
ありません。
== 関数 ==
=== 概要 ===
<source lang="lua">
love.graphics.discard( discardcolors, discardstencil )
</source>
=== 引数 ===
{{param (日本語)|table|discardcolors|An array containing boolean values indicating whether to discard the texture of each active Canvas, when multiple simultaneous Canvases are active.}}
{{param (日本語)|boolean|discardstencil (true)|Whether to discard the contents of the [[love.graphics.stencil|stencil buffer]] of the screen / active Canvas.}}
=== 返値 ===
ありません。
== 関連 ==
* [[parent::love.graphics (日本語)]]
* [[love.graphics.clear (日本語)]]
* [[Canvas (日本語)]]
* [[love.graphics.setBlendMode (日本語)]]
[[Category:Functions (日本語)]]
[[Sub-Category::Drawing (日本語)| ]]
{{#set:Description=Discards the contents of the screen or active [[Canvas]].}}
== そのほかの言語 ==
{{i18n (日本語)|love.graphics.discard}}