A render with time_to_live=1 is invisible, while a render with =2 is only visible for one tick.
Details
Tested draw_text and draw_circle both of which are affected. I guess the background logic is the same for all of them anyway?
Example code draws a pair of texts and a pair circles with ttl=2, which redrawn every two ticks should thus be consantly visible, but can be clearly seen flickering. Reducing ttl to 1 will not render anything at all.
Code: Select all
/c
local p = game.player
pcall(script.on_event,defines.events.on_tick,function(e)
game.speed = 0.1
local odd = e.tick % 2 == 1
local ttl = 2
rendering.draw_text{
text = odd and 'odd' or 'even',
color = odd and {r=1} or {g=1},
surface = p.surface,
target = p.character,
target_offset = odd and {0,0} or {2,0},
time_to_live = ttl,
}
rendering.draw_circle{
radius = 1/16,
filled = true,
text = odd and 'odd' or 'even',
color = odd and {r=1} or {g=1},
surface = p.surface,
target = p.character,
target_offset = odd and {0,0} or {2,0},
time_to_live = ttl,
}
end)