Replaced deprecated "display.getWidth" call
Handle screen orientation changes (fixes #1)