> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# cleardrawcache

> 清空 Real global Drawing object list。每个被跟踪的 Drawing object 都会被标记为 destroyed，存在 image resources 时会释放它们，并清空 object list。指向已清理 Drawing objects 的现有 Lua references 仍可能存在，但这些 objects 不再被视为 active Drawing objects。 the Drawing API 只在 the required rendering environment is active 为 true 时注册此 API；如果该检查为 false，initializer 会在创建这些 globals 之前返回。

<div className="real-function-page">
  ```lua theme={null}
  cleardrawcache()
  ```

  ## 示例

  Clear every Drawing object currently tracked by Real.

  ```lua theme={null}
  local square = Drawing.new("Square")
  square.Visible = true

  cleardrawcache()
  print(square.Visible)
  ```
</div>
