Make surface optional by the LuaRendering

Things that we aren't going to implement
Post Reply
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Make surface optional by the LuaRendering

Post by darkfrei »

Hi devs!

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/Lua ... draw_light
2020-05-24T14_36_18-Window.png
2020-05-24T14_36_18-Window.png (43.63 KiB) Viewed 814 times
Why the surface is not optional here? The entity already defines rendering surface, why it cannot be optional? The same for sprite and geometry for situations, where the target is an entity.

https://lua-api.factorio.com/latest/LuaRendering.html

Rseding91
Factorio Staff
Factorio Staff
Posts: 13219
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Make surface optional by the LuaRendering

Post by Rseding91 »

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.
If you want to get ahold of me I'm almost always on Discord.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Make surface optional by the LuaRendering

Post by darkfrei »

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.
But if surface was not defined, can it be rendered on the defined entity's surface?

Pseudocode:

Code: Select all

local surface = surface or target.entity and target.entity.surface

Post Reply

Return to “Won't implement”