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?Rseding91 wrote: Sun May 24, 2020 2:42 pm The target being an entity does not mean the sprite renders on that surface or as that sprite. All it does is make the light go away when the target does, and make it render with the orientation of that target.
Code: Select all
local surface = surface or target.entity and target.entity.surface