I am trying to make a modded element in lua that creates graphics as part of its update function. However, I noticed that they don't seem to be working. I've tried different view modes and tested it in console. The table for the graphics functions exists and the functions themselves exist, but calling them seems to do nothing. Even calling them with incorrect arguments doesn't cause an error. Is the graphics library deprecated like the old Lua API or am I using the functions wrong?
local function graphics(i,colr,colg,colb)
local life = sim.partProperty(i, sim.FIELD_LIFE)
local divide = life == 10 and 1 or (2.5-life/8)
return 0,1,255,colr/divide,colg/divide,colb/divide
end
elem.property(PBHL, "Graphics", graphics)
I was talking about the graphics.* or gfx.* functions. In particular, I wanted to use the gfx.fillCircle() function; however, I called it both in an update function and in the console and yet it did not appear nor return anything. It doesn't even return nil.