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

# imgui.create

> Cria um ImGui window record rastreado e retorna um ImGuiWindow object. O argumento title usa "REAL_IM_UI" quando omitido ou nil. O title deve ser unico entre os ImGui windows rastreados no momento; criar outro tracked window com o mesmo title gera um Lua error.

<div className="real-function-page">
  ```lua theme={null}
  imgui.create(title?: string): ImGuiWindow
  ```

  ## Argumentos

  <ParamField path={"title"} type={"string"}>
    Optional window title. Quando omitido ou nil, "REAL\_IM\_UI" e usado. Um title duplicado entre os ImGui windows rastreados no momento gera um Lua error.
  </ParamField>

  ## Retornos

  <ResponseField name={"window"} type={"ImGuiWindow"}>
    ImGuiWindow object com os window methods registrados em sua methods.
  </ResponseField>

  ## Tipos

  ### ImGuiWindow

  Identificador retornado por imgui.create. Os métodos de construção de controle retornam o mesmo identificador para que as chamadas possam ser encadeadas.

  | Name               | Type                                                                                                                                            | Required | Descrição                                                                                                    |
  | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
  | `Button`           | `(label: string, onClick: () -> ()) -> ImGuiWindow`                                                                                             | Yes      | Acrescenta um botão e invoca o retorno de chamada após um clique.                                            |
  | `Checkbox`         | `(label: string, checked: any, onChange: (boolean) -> ()) -> ImGuiWindow`                                                                       | Yes      | Acrescenta uma caixa de seleção inicializada no estado fornecido.                                            |
  | `CollapsingHeader` | `(label: string, content: (ImGuiWindow) -> ()) -> ImGuiWindow`                                                                                  | Yes      | Agrupa controles anexados pelo retorno de chamada de conteúdo abaixo de um cabeçalho recolhido.              |
  | `ColorPicker`      | `(label: string, red: number?, green: number?, blue: number?, alpha: number?, onChange: (number, number, number, number) -> ()) -> ImGuiWindow` | Yes      | Acrescenta um editor RGBA; os componentes de cores omitidos são padronizados como 1,0.                       |
  | `InputText`        | `(label: string, text: string?, onChange: (string) -> ()) -> ImGuiWindow`                                                                       | Yes      | Acrescenta uma entrada de texto de linha única; o texto inicial omitido é padronizado como uma string vazia. |
  | `SameLine`         | `() -> ImGuiWindow`                                                                                                                             | Yes      | Coloca o próximo controle na mesma linha.                                                                    |
  | `Separator`        | `() -> ImGuiWindow`                                                                                                                             | Yes      | Acrescenta um separador horizontal.                                                                          |
  | `SliderFloat`      | `(label: string, value: number, minimum: number, maximum: number, onChange: (number) -> ()) -> ImGuiWindow`                                     | Yes      | Acrescenta um controle deslizante de ponto flutuante.                                                        |
  | `SliderInt`        | `(label: string, value: integer, minimum: integer, maximum: integer, onChange: (number) -> ()) -> ImGuiWindow`                                  | Yes      | Acrescenta um controle deslizante inteiro.                                                                   |
  | `Text`             | `(text: string) -> ImGuiWindow`                                                                                                                 | Yes      | Acrescenta texto não interativo.                                                                             |
  | `destroy`          | `() -> ()`                                                                                                                                      | Yes      | Remove a janela e libera seus retornos de chamada registrados.                                               |

  ## Exemplo

  Crie um ImGui window e adicione controls ao ImGuiWindow object retornado.

  ```lua theme={null}
  local window = imgui.create("Runtime settings")

  window:Text("Controls")
  window:Separator()

  window:Checkbox("Enabled", true, function(enabled)
      print("Enabled:", enabled)
  end)

  window:SliderFloat("Opacity", 0.8, 0, 1, function(value)
      print("Opacity:", value)
  end)

  window:InputText("Label", "Real", function(text)
      print("Label:", text)
  end)

  window:ColorPicker("Accent", 0.3, 0.6, 1, 1, function(red, green, blue, alpha)
      print(red, green, blue, alpha)
  end)

  window:CollapsingHeader("Advanced", function(section)
      section:Text("Advanced controls go here")
  end)
  ```
</div>
