In my previous post, I explained why the Layout library isn’t suited for high-resolution screens. The short version is, that library is designed for a constant pixel density. Any layout that looked good on a high-resolution screen would look terrible on a low-resolution one, and vice versa.
Here, the header is not scaled vertically, which is why it appears so short. Ideally, we’d want a way to increase its height based on the device’s resolution.
Fortunately, OpenFL provides a way to access the pixel density of the current screen:
Capabilities.screenDPI. Now all we need is a layout library that supports pixel density scaling. Conveniently, I happen to have made one!
To convert SimpleSWFLayout to my library, follow these instructions.
Add that somewhere, and you’re done!
Also make sure not to compile for Flash or HTML5.
Capabilities.screenDPI just doesn’t work on those platforms. :/
Same device as before, but now I can actually see the details!
Ok, so there aren’t any details to see. But if there were details, I’d totally be able to see them!