Version: Unity 6.5 Beta (6000.5)
LanguageEnglish
  • C#

Painter2D.PushClip

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public void PushClip();

Description

Uses the current path as a clipping region. Subsequent Fill() and Stroke() operations will be clipped by this region.


The clipping process is very expensive, as it involves per-triangle clipping on the CPU. It is recommended to minimize the complexity of both the clipping path and the clipped content. Also avoid nested clipping regions when possible, as each additional clipping region adds more overhead to the clipping process.

Note that the clipped shapes will not have antialiased edges since the clipping path is applied by doing a per-triangle clipping process. Use PopClip() to remove the most recently added clipping region.