Hey friends,
So I've put together a simple game because I wanted something that ran on my phone - it spawns tiles, you click/tap the tiles, good times.
The problem I'm having is this: my phone (Galaxy S4) defaults to an unchangeable resolution of 1920x1080 (aka 1080p). As such, the tiles and fonts - which look fine on PC at the default 800x600 - are tiny on the phone.
My current workaround is to simply triple the size of the tiles and font if the game is running on Android (not with scaling - I tried that first, it made most text get drawn off screen).
It's 4:40am and I'm not much for math, so I was wondering if anyone could suggest an algorithm for appropriate font sizing/tile scaling to suit a variety of resolutions.
Love file attached, or find it here: https://dl.dropboxusercontent.com/u/512 ... tapv1.love
Similarly, the Android APK can be found here: https://dl.dropboxusercontent.com/u/512 ... etapv1.apk
Font Scaling
-
- Prole
- Posts: 10
- Joined: Mon Jun 23, 2014 6:32 pm
Font Scaling
- Attachments
-
- lovetapv1.love
- (108.75 KiB) Downloaded 407 times
Re: Font Scaling
love.window.getPixelScale() is what you need.
Re: Font Scaling
How does that help? And isn't it enough to just check what the resolution is with love.window.getHeight and love.window.getWidth?Joemag wrote:love.window.getPixelScale() is what you need.
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
Re: Font Scaling
It is used to display graphics at a size the user is expecting.T-Bone wrote:How does that help? And isn't it enough to just check what the resolution is with love.window.getHeight and love.window.getWidth?Joemag wrote:love.window.getPixelScale() is what you need.
Its better than getWidth and getHeight because for example my nexus 5 has a higher resolution than my nexus 7 but the screen is smaller.
And there are devices that have bigger screens and a higher resolution.
So it depends on the density and not on the resolution.
The best font size would for example be:
Code: Select all
12*love.window.getPixelScale()
-
- Prole
- Posts: 10
- Joined: Mon Jun 23, 2014 6:32 pm
Re: Font Scaling
I saw that method in the documentation and immediately assumed it was for dealing with retina displays. It works perfectly for this situation! Thanks, mate!
Who is online
Users browsing this forum: No registered users and 1 guest