GE Lua Documentation

Press F to search!

ImDrawList_AddRect

Definition


-- @/lua/common/extensions/ui/imgui_gen_luaintf.lua:2025
function M.ImDrawList_AddRect(ImDrawList_ctx, ImVec2_p_min, ImVec2_p_max, ImU32_col, float_rounding, ImDrawFlags_flags, float_thickness)
  if float_rounding == nil then float_rounding = 0 end
  if ImDrawFlags_flags == nil then ImDrawFlags_flags = 0 end
  if float_thickness == nil then float_thickness = 1 end
  ImDrawList_ctx:AddRect(ImVec2_p_min, ImVec2_p_max, ImU32_col, float_rounding, ImDrawFlags_flags, float_thickness)
end

Callers

@/lua/ge/extensions/editor/terrainEditor.lua
    -- draw background frame
    im.ImDrawList_AddRect(drawList, var.sc_curveWidgetPosA, im.ImVec2(var.sc_curveWidgetPosA.x+var.sc_curveWidgetSize, var.sc_curveWidgetPosA.y+var.sc_curveWidgetSize), var.sc_frameCol, 0, 0,2)
    -- draw the indentity line
@/lua/ge/extensions/editor/sceneTree.lua

        imgui.ImDrawList_AddRect(imgui.GetWindowDrawList(), localMouseDragStartPos, mouseDragEndPos, imgui.GetColorU322(imgui.ImVec4(1, 1, 0, 1)))
      end
@/lua/ge/extensions/editor/sensorConfigurationEditor.lua
    im.ImDrawList_AddRectFilled(drawList, sliderStart, sliderEnd, bgColor)
    im.ImDrawList_AddRect(drawList, sliderStart, sliderEnd, borderColor, 0, 0, 2)
@/lua/ge/extensions/flowgraph/builder.lua
    if self.drawDebug then
      if self.NodeRect then im.ImDrawList_AddRect(im.GetWindowDrawList(), self.NodeRect.top_left(), self.NodeRect.bottom_right(), im.GetColorU322(im.ImVec4(1, 0, 0, 1))) end
      if self.HeaderRect then im.ImDrawList_AddRect(im.GetWindowDrawList(), self.HeaderRect.top_left(), self.HeaderRect.bottom_right(), im.GetColorU322(im.ImVec4(0, 1, 0, 1))) end
      if self.NodeRect then im.ImDrawList_AddRect(im.GetWindowDrawList(), self.NodeRect.top_left(), self.NodeRect.bottom_right(), im.GetColorU322(im.ImVec4(1, 0, 0, 1))) end
      if self.HeaderRect then im.ImDrawList_AddRect(im.GetWindowDrawList(), self.HeaderRect.top_left(), self.HeaderRect.bottom_right(), im.GetColorU322(im.ImVec4(0, 1, 0, 1))) end
      if self.ContentRect then im.ImDrawList_AddRect(im.GetWindowDrawList(), self.ContentRect.top_left(), self.ContentRect.bottom_right(), im.GetColorU322(im.ImVec4(0, 0, 1, 1))) end
      if self.HeaderRect then im.ImDrawList_AddRect(im.GetWindowDrawList(), self.HeaderRect.top_left(), self.HeaderRect.bottom_right(), im.GetColorU322(im.ImVec4(0, 1, 0, 1))) end
      if self.ContentRect then im.ImDrawList_AddRect(im.GetWindowDrawList(), self.ContentRect.top_left(), self.ContentRect.bottom_right(), im.GetColorU322(im.ImVec4(0, 0, 1, 1))) end
    end
      if self.leftPinSize then
      --  im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(self.ContentRect.x + self.leftPinSize, self.ContentRect.y), im.ImVec2(self.ContentRect.x + self.leftPinSize, self.ContentRect.y + self.ContentRect.h), im.GetColorU322(im.ImVec4(1, 1, 1, 0.2)))
      end
      if self.rightPinSize then
      --  im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(self.ContentRect.x + self.ContentRect.w - self.rightPinSize, self.ContentRect.y), im.ImVec2(self.ContentRect.x + self.ContentRect.w - self.rightPinSize, self.ContentRect.y + self.ContentRect.h), im.GetColorU322(im.ImVec4(1,1,1, 0.2)))
      end
    if self.drawDebug then
      im.ImDrawList_AddRect(im.GetWindowDrawList(), itemRect.top_left(), itemRect.bottom_right(), im.GetColorU322(im.ImVec4(1, 0.25, 0, 1)))
    end
    if self.drawDebug then
      im.ImDrawList_AddRect(im.GetWindowDrawList(), itemRect.top_left(), itemRect.bottom_right(), im.GetColorU322(im.ImVec4(1, 1, 0.25, 1)))
    end
      local itemRect = GetItemRect()
      im.ImDrawList_AddRect(im.GetWindowDrawList(), itemRect.top_left(), itemRect.bottom_right(), im.GetColorU322(im.ImVec4(1, 0, 1, 1)))
    end
    --if self.drawDebug then
    --  im.ImDrawList_AddRect(im.GetWindowDrawList(), tempRect.top_left(), tempRect.bottom_right(), im.GetColorU322(im.ImVec4(1, 1, 1, 1)))
    --end
    --if self.drawDebug then
    --  im.ImDrawList_AddRect(im.GetWindowDrawList(), tempRect.top_left(), tempRect.bottom_right(), im.GetColorU322(im.ImVec4(1, 1, 1, 1)))
    --end
      local tempRect = GetItemRect()
      im.ImDrawList_AddRect(im.GetWindowDrawList(), tempRect.top_left(), tempRect.bottom_right(), im.GetColorU322(im.ImVec4(1, 0, 0, 1)))
    end
@/lua/ge/extensions/util/maptiles.lua
      -- Draw grid border
      im.ImDrawList_AddRect(drawList, cursorPos, im.ImVec2(cursorPos.x + gridWidth, cursorPos.y + gridHeight), im.GetColorU322(im.ImVec4(1, 1, 1, 1)))
@/lua/ge/extensions/editor/flowgraph/main.lua
                  -- display blue rectangle when node is hovered
                  im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(cursor.x + im.GetWindowPos().x - 2,
                                        cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
        local clr = im.IsItemHovered() and orangeColor or whiteColor
        im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(cursor.x + im.GetWindowPos().x - 2,
                            cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartTextView.lua
    local rMax = im.GetItemRectMax()
    im.ImDrawList_AddRect(
      im.GetWindowDrawList(),
@/lua/ge/extensions/flowgraph/link.lua
      )
    im.ImDrawList_AddRect(im.GetWindowDrawList(),
      im.ImVec2(center.x - txtSize.x/2 + off.x, center.y - txtSize.y/2 + off.y),
@/lua/common/extensions/ui/flowgraph/editor.lua
        if im.IsItemHovered() then
          im.ImDrawList_AddRect(im.GetWindowDrawList(), cPos, im.ImVec2(cPos.x + size.x, cPos.y + size.y), im.GetColorU322(im.ImVec4(1,0.6,0,0.5)), nil, nil, 1)
        end
@/lua/ge/extensions/editor/flowgraph/welcome.lua
  --im.EndChild()
  --im.ImDrawList_AddRect(im.GetWindowDrawList(), im.GetItemRectMin(), im.GetItemRectMax(), im.GetColorU322(im.ImVec4(1, 0, 0, 1)))
end
  im.Image(self.headerImage.texId, self.headerImageSize, im.ImVec2(0, 0), im.ImVec2(1, 1), col)
  --im.ImDrawList_AddRect(im.GetWindowDrawList(), im.GetItemRectMin(), im.GetItemRectMax(), im.GetColorU322(im.ImVec4(1, 0, 0, 1)))
  end
  --im.ImDrawList_AddRect(im.GetWindowDrawList(), im.GetItemRectMin(), im.GetItemRectMax(), im.GetColorU322(im.ImVec4(1, 0, 1, 1)))
  im.PopStyleVar()
  --im.ImDrawList_AddRect(im.GetWindowDrawList(), im.GetItemRectMin(), im.GetItemRectMax(), im.GetColorU322(im.ImVec4(0.5, 0, 1, 1)))
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/decal.lua
      local p2 = im.ImVec2(wpos.x + highlightSdfProperties.endCursorPos.x - scrollX + im.GetContentRegionAvailWidth(), wpos.y + highlightSdfProperties.endCursorPos.y - scrollY)
      im.ImDrawList_AddRect(im.GetWindowDrawList(), p1, p2, im.GetColorU322(editor.color.beamng.Value), nil, nil, 3)
    end
@/lua/ge/extensions/editor/dynamicDecals/layerStack.lua
  local p2 = im.ImVec2(wpos.x + cpos.x + im.GetContentRegionAvailWidth(), wpos.y + cpos.y + layerDropHeight - tool.getMainScrollY())
  im.ImDrawList_AddRect(im.GetWindowDrawList(), p1, p2, im.GetColorU322(editor.getTempImVec4_TableTable(colorTbl or {1,1,1,1})))
end
@/lua/ge/extensions/editor/flowgraph/nodelibrary.lua
  if self.buttonListIndex == self.selectedButtonListIndex then
    im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(cursor.x + im.GetWindowPos().x - 2,
                          cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
  if im.IsItemHovered() then
    im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(cursor.x + im.GetWindowPos().x - 2,
                          cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
  if im.IsItemHovered() then
    im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(cursor.x + im.GetWindowPos().x - 2,
                          cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
  if self.buttonListIndex == self.selectedButtonListIndex then
      im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(cursor.x + im.GetWindowPos().x - 2,
                            cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
        -- display blue rectangle when node is hovered
        im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(cursor.x + im.GetWindowPos().x - 2,
                              cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
@/lua/ge/extensions/editor/missionPlaybook/missionTreeViewer.lua
      )
    im.ImDrawList_AddRect(im.GetWindowDrawList(),
      im.ImVec2(center.x - txtSize.x/2 + off.x, center.y - txtSize.y/2 + off.y),
@/lua/ge/extensions/editor/flowgraph/examples.lua
  if self.buttonListIndex == self.selectedButtonListIndex then
    im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(cursor.x + im.GetWindowPos().x - 2,
                          cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
    -- display blue rectangle when node is hovered
    im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(cursor.x + im.GetWindowPos().x - 2,
                          cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
@/lua/ge/extensions/flowgraph/nodes/macro/io.lua
    local itemSize = {x = 100, y = 100}
    --[[im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(cursor.x + im.GetWindowPos().x - 2,
                          cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
@/lua/ge/extensions/flowgraph/nodes/debug/comment.lua
    im.ImDrawList_AddRectFilled(im.GetWindowDrawList(), rMin, rMax, col1, 4)
    im.ImDrawList_AddRect(im.GetWindowDrawList(), rMin, rMax, col2, 4)
    im.SetCursorScreenPos(min)
@/lua/ge/extensions/editor/dynamicDecals/widgets.lua
  local scrollY = im.GetScrollY()
  im.ImDrawList_AddRect(
    im.GetWindowDrawList(),
    local p2 = im.ImVec2(wpos.x + endCursorPos.x - scrollX + im.GetContentRegionAvailWidth() + style.ItemSpacing.x / 2, wpos.y + endCursorPos.y - scrollY)
    im.ImDrawList_AddRect(im.GetWindowDrawList(), p1, p2, im.GetColorU322(editor.color.beamng.Value), nil, nil, 2)
  end
@/lua/ge/extensions/flowgraph/baseStateNode.lua

  --im.ImDrawList_AddRect(im.GetWindowDrawList(), builder.NodeRect.top_left(), builder.NodeRect.bottom_right(), im.GetColorU322(im.ImVec4(1, 1, 0, 1)))
  -- setup link strengths for all of these pins.
@/lua/ge/extensions/editor/resourceChecker.lua
    im.ImDrawList_AddRectFilled(dl, im.ImVec2(r.x, r.y), im.ImVec2(r.x+r.w, r.y+r.h), im.GetColorU322(c))
    im.ImDrawList_AddRect(dl, im.ImVec2(r.x, r.y), im.ImVec2(r.x+r.w, r.y+r.h), im.GetColorU322(im.ImVec4(0,0,0,0.35)))
    if assetTreemapState.selectedPath == path then
      im.ImDrawList_AddRect(dl, im.ImVec2(r.x+1, r.y+1), im.ImVec2(r.x+r.w-1, r.y+r.h-1), im.GetColorU322(im.ImVec4(1,1,1,0.9)), 0, 0, 2.0)
    end
              if hovered then
                im.ImDrawList_AddRect(dl, min, max, im.GetColorU322(im.ImVec4(1, 1, 1, 0.35)))
                im.BeginTooltip()
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamModifierLeakVis.lua

                  im.ImDrawList_AddRect(
                    im.GetWindowDrawList(),
@/lua/ge/extensions/editor/flowgraph/search.lua
  if self.buttonListIndex == self.selectedButtonListIndex then
    im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(cursor.x + im.GetWindowPos().x - 2,
                          cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
    -- display blue rectangle when node is hovered
    im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(cursor.x + im.GetWindowPos().x - 2,
                          cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
@/lua/ge/extensions/editor/inspector.lua

  imgui.ImDrawList_AddRect(imgui.GetWindowDrawList(), p_Min, p_Max, handleColor, nil, nil, 2)
      imgui.ImDrawList_AddRectFilled(imgui.GetWindowDrawList(), p1_HandleColorLabel, p2_HandleColorLabel, imgui.GetColorU322(groundCoverUVHandleColors[groundCoverUVHandleColorIndex].color))
      imgui.ImDrawList_AddRect(imgui.GetWindowDrawList(), imgui.ImVec2(p1_HandleColorLabel.x - 1, p1_HandleColorLabel.y - 1), imgui.ImVec2(p2_HandleColorLabel.x + 1, p2_HandleColorLabel.y + 1), imgui.GetColorU322(imgui.ImVec4(0, 0, 0, 1)), nil, nil, 1)
          imgui.ImDrawList_AddRectFilled(drawlist, p1_BG, p2_BG, imgui.GetColorU322(val.color))
          imgui.ImDrawList_AddRect(drawlist, imgui.ImVec2(p1_BG.x - 1, p1_BG.y - 1), imgui.ImVec2(p2_BG.x + 1, p2_BG.y + 1), imgui.GetColorU322(imgui.ImVec4(0, 0, 0, 1)), nil, nil, 1)
      imgui.ImDrawList_AddRectFilled(imgui.GetWindowDrawList(), p1_bgColorLabel, p2_bgColorLabel, imgui.GetColorU322(groundCoverUVBgColors[groundCoverUVBgColorIndex].color))
      imgui.ImDrawList_AddRect(imgui.GetWindowDrawList(), imgui.ImVec2(p1_bgColorLabel.x - 1, p1_bgColorLabel.y - 1), imgui.ImVec2(p2_bgColorLabel.x + 1, p2_bgColorLabel.y + 1), imgui.GetColorU322(imgui.ImVec4(0, 0, 0, 1)), nil, nil, 1)
          imgui.ImDrawList_AddRectFilled(drawlist, p1_BG, p2_BG, imgui.GetColorU322(val.color))
          imgui.ImDrawList_AddRect(drawlist, imgui.ImVec2(p1_BG.x - 1, p1_BG.y - 1), imgui.ImVec2(p2_BG.x + 1, p2_BG.y + 1), imgui.GetColorU322(imgui.ImVec4(0, 0, 0, 1)), nil, nil, 1)