This shouldn't be hardcoded, but based on the value from the surface variable given to the Map object. Also, the Python coding style is that variables are all lowercase with words separated by underscores. So screenWidth => screen_width.