There are three options that i see:
- Ask a user at start or in options what is his screen size in inches and calculate it
- Publish different versions for different devices
- Use function:
get_model_name() (don’t know if this really returns model of device because it’s undescripted in help)
Thanks for the suggestions, but seriously? There is
on Android, not sure about iOS and in Unity it’s
Pretty sure the typical user is not too keen to figure out and enter device specifications.
Martin Eigel | 2016-03-29 22:07
Where did you found this? Can’t find it in api.
I gave a downvote because i really think these solutions are “thin”.
I think its a really bad idea to assume that the user knows the screen size, I would say that it is always best to assume that the user is “stupid”.
To publish a version for different devices could be possible in some cases, but even if for example a version is for “mobile” only there are still a ton of screen sizes and resolutions.
I am not sure how
get_model_name() works on different devices, only tried it on desktop pc where it just returns “generic device” and therefor tells us absolutely nothing. Even if it returns the exact model it would still require to have a huge list of models and the respective screen size, and when new devices are in sales, we would have to update that list.
If it isn’t for some very specific case, design your game to be responsive! One way or another.
Godot even have some build in methods of handling different screen sizes/resolutions
Rasmus | 2016-12-30 12:05
Haven’t tried it out myself but maybe look at
Might need to do
Just to get the dpi from the screen where your game runs if there should be multiple screens.
Rasmus | 2016-12-30 11:41