Make sure pos is set before using it to determine the screen offset.