Page 85 of 91

Re: "Questions that don't deserve their own thread" thread

Posted: Wed Dec 07, 2016 2:23 am
by Beelz
Pyuu wrote:
zorg wrote:-snip-
Telling them to get font 'xyz' themselves isn't something you should bank on either. :monocle:
The reason I'm curious about this is for common fonts that you can almost bet on existing on most end-user's PCs, such as Arial or Tahoma. Also, detection of those fonts existence and using reasonable alternative fonts based on OS and prepackaged fonts when they don't exist would be a good way to go about not having fonts. (It may cause the experience to differ slightly, but it still avoids the need to go about distribution licenses and potential copyright infringement when packaging the game.)
For the most part, trying to figure out the licencing on system fonts is a hassle... You're better off finding a font to distribute with your game. I've used 1001 Free Fonts a ton and they usually come with a readme for distribution details. Then just keep your font library organized and its smooth sailing.

Re: "Questions that don't deserve their own thread" thread

Posted: Wed Dec 07, 2016 3:55 am
by Positive07
Sometimes a feature like detecting system fonts is usable for example in editing programs, you probably want a dropdown so the user can chose a font, but you don't want to include a lot of fonts with the program itself, and you want to let the user use their own fonts, so detecting available fonts is a good idea. This programs are very specific though, image and video edition software, document processors like Word, Excel, PowerPoint and code editors.

I would like this feature not as a part of LÖVE but as an external library which most likely would have to pick up the available fonts names and then have a function to load any such font and return a LÖVE Font... I'm pretty sure this could be done, if someone has more info please write it, it might spark some interest

Re: "Questions that don't deserve their own thread" thread

Posted: Wed Dec 07, 2016 1:44 pm
by unixfreak
I'm trying to set a randomly rotated image
But i only end up with integers, for example;

Code: Select all

-- returns 0,1,2,3 
love.math.random(math.pi)

-- same as above
love.math.random(0.0, math.pi)
The angle of a placed image isn't as random as i'd like it to be. How can i get math.random / love.math.random to choose a random floating number?

EDIT; DO'H math has never been my strong point but this gives what i need;

Code: Select all

love.math.random(math.pi*10)/10
Solved i guess.

Re: "Questions that don't deserve their own thread" thread

Posted: Wed Dec 07, 2016 2:05 pm
by Nixola
You could also do

Code: Select all

love.math.random()*math.pi

Re: "Questions that don't deserve their own thread" thread

Posted: Wed Dec 07, 2016 8:54 pm
by zorg
If you give at least one argument to love.math.random, it will output integers less than the number. You wanted what Nixola wrote.

Re: "Questions that don't deserve their own thread" thread

Posted: Thu Dec 08, 2016 9:21 pm
by jakie
I want to export Love2d to my android device.
What's the best way to find the dimensions of my phone?

EDIT: Nvm solved.

Re: "Questions that don't deserve their own thread" thread

Posted: Sat Dec 10, 2016 3:12 am
by jakie
My project is too big for my monitor. I have a Samsung galaxy s6 with the dimensions 1440 x 2560 pixels
How can I test my project on the PC and Android? Or should I just forget about running it on the PC at all.

Re: "Questions that don't deserve their own thread" thread

Posted: Sat Dec 10, 2016 4:02 am
by Positive07
Android, iOS and Mac use PixelScale (which you can get with [wiki]love.window.getPixelScale[/wiki]), this works like this, if the PixelScale is 4 then 1dip (density independant pixel) is 4 actual pixels. You want to draw with dip units so then you scale everything by the PixelScale and get beutiful results.

So since the S6 has a PixelScale of 4 then you will have a 360dip x 640dip drawing area. And since your computer has a PixelScale of 1 (most systems use this) and it is most likely 800px x 600px (at least) then your monitor has a drawing area of 800dip x 600 dip which is bigger than your phone!

This is useful too because Google recommends a touch target of 48dip which in your phone would be 184px!

NOTE: Calling them dip (density independant pixels/points) is most likely wrong, I just wanted to explain the concept

Re: "Questions that don't deserve their own thread" thread

Posted: Sat Dec 10, 2016 4:19 am
by raidho36
I think what you should be using is adjustible screen dimensions. If you use rigid numbers for the screen resolution, then it will only work well for screens with that exact resolution, and will be broken for everything else one way or another.

Re: "Questions that don't deserve their own thread" thread

Posted: Sat Dec 10, 2016 5:32 am
by Positive07
Of course, you need a combination of both, I recommend dips for the sake of touch input (Hell having a 48px button on a screen with 4x pixel scale would be a pain) but then you have to dynamically resize your drawing area because your phone may be 360x640 but other may be 320x600 and so on... So the size and or aspect ratio may not be the same and you should adapt to it (which is a pain but one that is needed to give the best user experience everywhere)

SO! Adapt to the user screen dinamically, by scaling, adding black borders or whatever. And make sure that all your input has a good touch target of 48dips!