Skip to content

DrawFilledCircle

The DrawFilledCircle function draws a filled circle in 3D space. This function is useful for visualizing solid circular areas or regions in the game world.

Parameters

  • x (number): The x-coordinate of the circle's center.
  • y (number): The y-coordinate of the circle's center.
  • z (number): The z-coordinate of the circle's center.
  • r (number): The red color component (0.0 to 1.0).
  • g (number): The green color component (0.0 to 1.0).
  • b (number): The blue color component (0.0 to 1.0).
  • a (number): The alpha (transparency) value (0.0 to 1.0).
  • radius (number): The radius of the circle.
  • height (number): The height of the circle (for 3D effect).

Example Usage in Lua

Here is an example of how to use the DrawFilledCircle function in Lua:

local api = ...

-- Function to draw a filled red circle with specified radius and color at the given coordinates
function DrawFilledRedCircle(x, y, z, radius, height)
    local r = 1.0
    local g = 0.0
    local b = 0.0
    local a = 1.0
    api.DrawFilledCircle(x, y, z, r, g, b, a, radius, height)
    print("Drew a filled red circle at (" .. x .. ", " .. y .. ", " .. z .. ") with radius " .. radius .. " and height " .. height)
end

-- Example usage: Draw a filled red circle at coordinates (10, 20, 30) with radius 5 and height 2
DrawFilledRedCircle(10, 20, 30, 5, 2)