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

# Drawing.new

> Tao Drawing object moi cua loai duoc yeu cau va them vao Real tracked Drawing object list. type string phai la mot trong cac ten duoc ho tro chinh xac: "Line", "Text", "Circle", "Square", "Quad", "Triangle", "Image". Gia tri bi thieu, non-string hoac type values khong duoc ho tro se tao Lua error. the Drawing API chi dang ky API nay khi the required rendering environment is active la true; khi kiem tra do la false, initializer quay lai truoc khi tao cac globals nay.

<div className="real-function-page">
  ```lua theme={null}
  Drawing.new(objectType: "Image" | "Line" | "Text" | "Circle" | "Square" | "Quad" | "Triangle"): DrawingObject
  ```

  ## Đối số

  <ParamField path={"objectType"} type={"\"Image\" | \"Line\" | \"Text\" | \"Circle\" | \"Square\" | \"Quad\" | \"Triangle\""} required>
    Ten Drawing type chinh xac can tao. Cac gia tri duoc ho tro la "Line", "Text", "Circle", "Square", "Quad", "Triangle", "Image".
  </ParamField>

  ## Giá trị trả về

  <ResponseField name={"object"} type={"DrawingObject"}>
    Drawing object da tao voi Drawing object type.
  </ResponseField>

  ## Ví dụ

  Tạo một hình vuông hiển thị và cấu hình các thuộc tính vẽ cơ bản của nó.

  ```lua theme={null}
  local square = Drawing.new("Square")
  square.Position = Vector2.new(120, 120)
  square.Size = Vector2.new(220, 120)
  square.Color = Color3.fromRGB(120, 170, 255)
  square.Filled = true
  square.Visible = true
  ```
</div>
