Looking for examples of adding icons on top of player characters or enemies
Posted: Sun May 10, 2020 11:18 am
by slikts
I'd like to add icons on top of the things that move, but their definitions are somewhat complex, so it'd be very useful to have an example of how it could be done.
Re: Looking for examples of adding icons on top of player characters or enemies
events.on_event(defines.events.on_tick,function()
for k,ent in pairs(ENTITIES_WE_WANT_SPRITES_TO_FOLLOW)do
for i,sprite in pairs(global.sprite_cache[ent.unit_number])do
rendering.set_position(sprite,ent.position)
end
end
end)
/thread
Re: Looking for examples of adding icons on top of player characters or enemies
Posted: Sun May 10, 2020 12:34 pm
by Bilka
Without usage of on_tick, the sprite will follow the target around: