Here is the example:
Code: Select all
/c
local entity = game.player.selected
rendering.draw_light {sprite = "utility/light_medium", surface = entity.surface, target = entity}
https://lua-api.factorio.com/latest/LuaRendering.html
Code: Select all
/c
local entity = game.player.selected
rendering.draw_light {sprite = "utility/light_medium", surface = entity.surface, target = entity}
But if surface was not defined, can it be rendered on the defined entity's surface?
Code: Select all
local surface = surface or target.entity and target.entity.surface