added function to get width of rendered text
added flexible centering for the death message