DrawFilledCone
The DrawFilledCone function draws a filled cone in 3D space. This function is useful for visualizing solid conical areas or regions in the game world.
Parameters
bossX(number): The x-coordinate of the cone's base center.bossY(number): The y-coordinate of the cone's base center.bossZ(number): The z-coordinate of the cone's base center.bossFacing(number): The facing direction of the cone's base center.coneLength(number): The length of the cone.coneAngle(number): The angle of the cone.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).thickness(number): The thickness of the cone's outline.
Example Usage in Lua
Here is an example of how to use the DrawFilledCone function in Lua:
local api = ...
-- Function to draw a filled green cone with a length of 10, angle of 45 degrees, and thickness of 2 at the specified coordinates
function DrawFilledGreenCone(bossX, bossY, bossZ, bossFacing)
local coneLength = 10.0
local coneAngle = 45.0
local r = 0.0
local g = 1.0
local b = 0.0
local a = 1.0
local thickness = 2.0
api.DrawFilledCone(bossX, bossY, bossZ, bossFacing, coneLength, coneAngle, r, g, b, a, thickness)
print("Drew a filled green cone at (" .. bossX .. ", " .. bossY .. ", " .. bossZ .. ") facing " .. bossFacing .. " with length " .. coneLength .. ", angle " .. coneAngle .. ", and thickness " .. thickness)
end
-- Example usage: Draw a filled green cone at the targets coordinates
local boss_facing = api.GetObjectFacing('target')
local x,y,z = api.GetObjectPosition('target')
DrawFilledGreenCone(x,y,z,boss_facing)