Page 1 of 1

Expose entity graphics within LuaEntityPrototype

Posted: Tue Jan 27, 2026 8:58 am
by BurninSun
I want to use rendering.draw_animation or rendering.draw_sprite to draw my own copies of entities. Currently, the only way to get those graphics is by iterating entities and copying their graphic information into an animation/sprite prototype during data stage.

I would like LuaEntityPrototype to have an attribute of sprite or animation which returns something which can be passed directly to rendering.draw_animation/sprite.

Re: Expose entity graphics within LuaEntityPrototype

Posted: Wed Jan 28, 2026 1:11 pm
by Rseding91
There's no simple or generic way to make this work on the engine side. Near every entity has some special rendering logic in how it eventually shows in-game. That makes it impossible to simply map an entity to "draw sprite/animation" without hand-written logic for every case (functionally copying the drawing code from each entity).