> ## 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.

# setrenderproperty

> 将 value 赋给 object[property]。对于 Drawing object，这会使用与 direct property assignment 相同的 Drawing property assignment。unknown Drawing properties 会被忽略，destroyed Drawing objects 不会被更改。第三个参数必须存在。 the Drawing API 只在 the required rendering environment is active 为 true 时注册此 API；如果该检查为 false，initializer 会在创建这些 globals 之前返回。

<div className="real-function-page">
  ```lua theme={null}
  setrenderproperty(object: any, property: any, value: any)
  ```

  ## 参数

  <ParamField path={"object"} type={"any"} required>
    要索引并赋值的值。对于 Drawing object，会使用 RealDrawingObject \_\_newindex handler。
  </ParamField>

  <ParamField path={"property"} type={"any"} required>
    用于赋值的 property key。Drawing object properties 基于 strings。
  </ParamField>

  <ParamField path={"value"} type={"any"} required>
    赋给 object\[property] 的值。该参数必须提供；nil 仍然是已提供的值。
  </ParamField>

  ## 示例

  通过通用属性助手更新绘图属性。

  ```lua theme={null}
  local line = Drawing.new("Line")
  setrenderproperty(line, "Thickness", 3)
  setrenderproperty(line, "Visible", true)

  print(line.Thickness)
  print(line.Visible)
  ```
</div>
