Don't draw entities that are outside the screen.
Lua: add functions entity:is/set_visible().