Page 17 of 33

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

Posted: Thu Mar 20, 2014 8:21 pm
by josefnpat
Luke100000 wrote:I don't understand how I can create now a .apk.
I've found this [...] But I don't understand this...
Please no unhelpful comments, thanks.
What part do you not understand?

Have you read the "Building Love for X" on the wiki so you know how to use ndk-build and adb?

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

Posted: Fri Mar 21, 2014 8:35 pm
by Ratchet
Can someone post a simple example of a working one-finger-moving/scrolling/drag and drop, please? I don't get it...

Code: Select all

tx = 0
ty = 0
mx = 0
my = 0
px = 0
py = 0
gw = love.graphics.getWidth()
gh = love.graphics.getHeight()

function love.draw()
	love.graphics.translate(tx, ty)
	love.graphics.print(gw.." x ".. gh, 100, 100)
	love.graphics.print(mx.." x ".. my, 100, 150)
	love.graphics.print(px.." x ".. py, 100, 200)
end

function love.touchpressed(id, x, y, p)
	mx = x
	my = y
	px = (gw * (x - mx))
	py = (gh * (y - my))
end

function love.touchmoved(id, x, y, p)
      tx = tx + (gw * (x - mx))
      ty = ty + (gh * (y - my))
      px = (gw * (x - mx))
      py = (gh * (y - my))
end

function love.keypressed(key)
   if key == "escape" then
      love.event.quit()
   end
end

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

Posted: Fri Mar 21, 2014 8:49 pm
by slime
The x and y parameters for love.touchmoved (and other touch functions) are the absolute position of the finger on the touch device in normalized [0, 1] coordinates, rather than the change in position since the previous touchmoved event.

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

Posted: Fri Mar 21, 2014 9:42 pm
by Ratchet
Workes now. Thanks.

Code: Select all

tx = 0
ty = 0
mx = 0
my = 0
px = 0
py = 0
gw = love.graphics.getWidth()
gh = love.graphics.getHeight()

function love.draw()
	love.graphics.translate(tx, ty)
	love.graphics.print(gw.." x ".. gh, 100, 100)
	love.graphics.print(mx.." x ".. my, 100, 150)
	love.graphics.print(px.." x ".. py, 100, 200)
end

function love.touchpressed(id, x, y, p)
	mid = id
	mx = x
	my = y
	px = (gw * (x - mx))
	py = (gh * (y - my))
end

function love.touchmoved(id, x, y, p)
	if id == mid then
		tx = tx + (gw * (x - mx))
		ty = ty + (gh * (y - my))
		px = (gw * (x - mx))
		py = (gh * (y - my))
		mx = x
		my = y
	end
end

function love.keypressed(key)
   if key == "escape" then
      love.event.quit()
   end
end

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

Posted: Fri Mar 21, 2014 10:08 pm
by Positive07
slime wrote:The x and y parameters for love.touchmoved (and other touch functions) are the absolute position of the finger on the touch device in normalized [0, 1] coordinates, rather than the change in position since the previous touchmoved event.
I think that I added that to the love-android wiki... And made a issue report just to know that it wasn't a bug.

Ratchet wrote:

Code: Select all

tx = 0
ty = 0
mx = 0
my = 0
px = 0
py = 0
gw = love.graphics.getWidth()
gh = love.graphics.getHeight()

function love.draw()
	love.graphics.translate(tx, ty)
	love.graphics.print(gw.." x ".. gh, 100, 100)
	love.graphics.print(mx.." x ".. my, 100, 150)
	love.graphics.print(px.." x ".. py, 100, 200)
end

function love.touchpressed(id, x, y, p)
	mid = id
	mx = x
	my = y
	px = (gw * (x - mx))
	py = (gh * (y - my))
end

function love.touchmoved(id, x, y, p)
	if id == mid then
		tx = tx + (gw * (x - mx))
		ty = ty + (gh * (y - my))
		px = (gw * (x - mx))
		py = (gh * (y - my))
		mx = x
		my = y
	end
end

function love.keypressed(key)
   if key == "escape" then
      love.event.quit()
   end
end
Also I really like that script... It's pretty simple

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

Posted: Fri Mar 21, 2014 10:10 pm
by alberto_lara
Please no unhelpful comments, thanks.
Oh, the irony...

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

Posted: Fri Mar 28, 2014 2:14 pm
by Satinxs
Hi guys! I have a generic tablet (Tablet Titan 7010) and when I try to run Love for Android it simply displays a blue screen intead of the no-screen.
I've tested it on my phone (Samsung Galaxy Y) and it works perfectly on it. I have no idea why it doesn't work on the tablet. Maybe the GPU drivers don't function properly? But I've had no problem with other games...

I googled around and couldn't fix this issue, I hope you can help me...

EDIT: Just in case it helps someone figure this out, here is my tablet's specs: https://dl.dropboxusercontent.com/u/292 ... 29sdk.html

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

Posted: Fri Mar 28, 2014 2:19 pm
by tio
Satinxs wrote:Hi guys! I have a generic tablet (Tablet Titan 7010) and when I try to run Love for Android it simply displays a blue screen intead of the no-screen.
I've tested it on my phone (Samsung Galaxy Y) and it works perfectly on it. I have no idea why it doesn't work on the tablet. Maybe the GPU drivers don't function properly? But I've had no problem with other games...

I googled around and couldn't fix this issue, I hope you can help me...
My friend (with a Moto G, android 4.4.2) complains exactly the same thing. The game tested works fine in a Galaxy 2 and Galaxy Tab 2 (10").

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

Posted: Sat Mar 29, 2014 5:41 am
by Positive07
tio wrote:
Satinxs wrote:Hi guys! I have a generic tablet (Tablet Titan 7010) and when I try to run Love for Android it simply displays a blue screen intead of the no-screen.
I've tested it on my phone (Samsung Galaxy Y) and it works perfectly on it. I have no idea why it doesn't work on the tablet. Maybe the GPU drivers don't function properly? But I've had no problem with other games...

I googled around and couldn't fix this issue, I hope you can help me...
My friend (with a Moto G, android 4.4.2) complains exactly the same thing. The game tested works fine in a Galaxy 2 and Galaxy Tab 2 (10").
Could you check with logcat?

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

Posted: Sat Mar 29, 2014 3:51 pm
by Satinxs
Positive07 wrote:Could you check with logcat?
Will try as soon as possible! Thank you for the help! :)