Page 29 of 33

Re: love-android-sdl2 (native, 0.9.0)

Posted: Sat Feb 07, 2015 1:48 pm
by Muris
I was wondering what would be the best way to use google play services? Lets say for example I would want to use multiplayer games from google play store, would it even be possible? I suppose I would need to somehow make some call throughs from java to lua, would this be hard to do, assuming I ever even get the java side working for using achievements or whatever I desire to use from the google play api?

I have been thinking about using this, but I am still not sure how easy it would be to implement multiplayer, not to mention how easy the api is to work with: https://developers.google.com/games/ser ... ultiplayer

Re: love-android-sdl2 (native, 0.9.0)

Posted: Sat Feb 07, 2015 7:06 pm
by Positive07
If I was in your place I would use the C++ backend of google play services, it's the same but in C++ and you can make it compile with the NDK. From there it should be pretty straight forward and you could even compile LÖVE AND LÖVE for Android with it... Just saying

Re: love-android-sdl2 (native, 0.9.0)

Posted: Tue Feb 10, 2015 10:19 pm
by fysx
Mermersk wrote: But what is love.o ? And how can this be fixed? What is armeabi? Remember installing it when I was selecting Android SDK plugins or something.
Try to run

Code: Select all

ndk-build clean
and then

Code: Select all

ndk-build
again.

This allows you remove old binary files.

Re: love-android-sdl2 (native, 0.9.0)

Posted: Sat Feb 21, 2015 11:02 pm
by Ranguna259
I'm trying to code shaders but it doesn't work, love crashes whenever I try to load code with for loops:

Code: Select all

C5013: profile does not support "for" stantements and "for" could not be unrolled.
I've tried:

Code: Select all

#pragma target 3.0
But it keeps on crashing.

Try it out with this bloom shader:

Code: Select all

#pragma target 3.0
extern vec2 size;
extern float samples;// = 5.0; // pixels per axis; higher = bigger glow, worse performance
extern float quality;// = 2.5; // lower = smaller glow, better quality
 
vec4 effect(vec4 colour, Image tex, vec2 tc, vec2 sc)
{
	vec4 source = Texel(tex, tc);
	vec4 sum = vec4(0.0);
	float diff = (samples - 1.0) / 2.0;
	vec2 sizeFactor = vec2(1.0) / size * quality;
	for (float x = -diff; x <= diff; x++)
	{
		for (float y = -diff; y <= diff; y++)
		{
			vec2 offset = vec2(x, y) * sizeFactor;
			sum += Texel(tex, tc + offset);
		}
	}
	return ((sum / (samples * samples)) + source) * colour;
} 

Re: love-android-sdl2 (native, 0.9.0)

Posted: Wed Feb 25, 2015 1:20 pm
by fysx
for loops must have a constant number of iterations on OpenGL ES on mobile. You unfortunately define the lengths using a uniform :( . See also http://stackoverflow.com/questions/1892 ... form-varia

Re: love-android-sdl2 (native, 0.9.0)

Posted: Thu Mar 12, 2015 11:15 am
by Ranguna259
How do I get the DPI type: ldpi, mdpi, hdpi...?

Re: love-android-sdl2 (native, 0.9.0)

Posted: Thu Mar 12, 2015 4:40 pm
by slime
love.window.getPixelScale (or use [wiki]love.window.fromPixels[/wiki] and [wiki]love.window.toPixels[/wiki] to convert between pixels and Android's concept of density-independent pixels, i.e. use the dpi scale.)

Re: love-android-sdl2 (native, 0.9.0)

Posted: Thu Mar 12, 2015 6:15 pm
by Ranguna259
Thanks, I've searched I bit more for dpi scale factor and found how to convert the scale factor to qualifiers, link.

Re: love-android-sdl2 (native, 0.9.0)

Posted: Wed Apr 01, 2015 1:55 am
by TurtleP
I've been wondering: why does setTextInput's keyboard translate the game's graphics upward? Is this just me, or does it happen to everyone else?

Re: love-android-sdl2 (native, 0.9.0)

Posted: Wed Apr 01, 2015 2:52 am
by slime
setTextInput adjusts the game's window in order to display the on-screen keyboard while keeping the text that's written on-screen as well.

You can inform the system about where your text will display by using the optional x,y,w,h parameters of setTextInput (available in the Android and iOS versions of LÖVE.) They should be set to the location and size of where your text will be showing up on-screen.