to_word_idx = function(y) local idx = math.floor((y-50)/Line_height/2) if idx >= 1 and idx <= #Words then return idx end end