LuaRendering::draw_icon()

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
Quezler
Fast Inserter
Fast Inserter
Posts: 160
Joined: Fri Mar 25, 2016 6:37 pm
Contact:

LuaRendering::draw_icon()

Post by Quezler »

It would be nice if you could draw alt-mode like icons with luarendering, LuaRendering::draw_sprite() exists but it is insufficient, it cannot:
- draw those sdf/shadow things neatly around icons like alt mode would
- draw quality (tbh just add another draw_sprite() for that, but this request is aimed for the shadow effect, but if we get that this would be nice too)

So i would like a way to request that with luarendering we can get those outlines/shadows so we can draw realistic looking alt-mode's ourselves,
currently we modders are limited to shadow sprites or drawing the icon in black a little bigger, like the factorissimo and ltn thought bubble mod:
Screenshot 2025-03-05 at 13.01.26.png
Screenshot 2025-03-05 at 13.01.26.png (533.83 KiB) Viewed 221 times
Screenshot 2025-03-05 at 13.03.25.png
Screenshot 2025-03-05 at 13.03.25.png (67.49 KiB) Viewed 221 times
This can be made to resemble a somewhat familiar look but it is still very far off in lots of subtle ways.

Therefore the MVP of this request is being able to draw the outline/background/sdf for items/fluids/signals/etc icons, things that never render as alt mode icons anyways can safely be ignored/excluded.

A more advanced version would be similar to https://lua-api.factorio.com/latest/pro ... cification or https://lua-api.factorio.com/latest/typ ... oning.html where you can specify one (or more) items/fluids/signals/etc and have the luarenderer take care of their size/spacing/positioning based on the parameters provided and/or the target entity.

A built-in quality draw option would be welcome too if something icon specific is being added anyways, but unlike the above it already has workarounds.
protocol_1903
Fast Inserter
Fast Inserter
Posts: 204
Joined: Fri Sep 09, 2022 4:33 pm
Contact:

Re: LuaRendering::draw_icon()

Post by protocol_1903 »

+1, would help immensely in a number of scenarios I've seen recently.
Quezler wrote: Wed Mar 05, 2025 12:09 pm A built-in quality draw option would be welcome too if something icon specific is being added anyways, but unlike the above it already has workarounds.
This would also be awesome, perhaps when specifying a sprite for LuaGUI (Sprite or SpriteButton) perhaps it could be a table, then a property `quality` could be specified to have that rendered over top? I couldn't figure out how to render layered sprites runtime, this would help immensely.
If you need to reach me, message me on discord.

I make qol mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
If you have a mod idea, I can look into it.
s6x
Inserter
Inserter
Posts: 41
Joined: Fri Nov 15, 2024 8:22 pm
Contact:

Re: LuaRendering::draw_icon()

Post by s6x »

This would definitely be useful. I managed to get Lab Icon Revert looking "good enough" by drawing the shadows myself but it would definitely be nice to be able to do this automatically.
Post Reply

Return to “Modding interface requests”