Variables in functions ... What is best?

If that was me, I'd put that display functionality in a class and let the properties of the display be set in the constructor and held as instance variables. That way you don't restrict your display logic to just supporting that one display type, you could even support multiple displays concurrently if you wanted, but you don't need to have the display properties scattered around your code.