love-android-sdl2 (native, 0.9.2)

A project to port LÖVE to Android handhelds
Locked
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

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

Post 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?
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
User avatar
Ratchet
Citizen
Posts: 67
Joined: Mon Apr 08, 2013 10:32 am

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

Post 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
Last edited by Ratchet on Fri Mar 21, 2014 10:00 pm, edited 5 times in total.
macOS 10.14 Mojave | LÖVE 11.2
User avatar
slime
Solid Snayke
Posts: 3144
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

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

Post 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.
User avatar
Ratchet
Citizen
Posts: 67
Joined: Mon Apr 08, 2013 10:32 am

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

Post 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
macOS 10.14 Mojave | LÖVE 11.2
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

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

Post 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
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

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

Post by alberto_lara »

Please no unhelpful comments, thanks.
Oh, the irony...
User avatar
Satinxs
Prole
Posts: 9
Joined: Thu Jun 14, 2012 4:14 pm

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

Post 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
Last edited by Satinxs on Fri Mar 28, 2014 2:50 pm, edited 1 time in total.
User avatar
tio
Citizen
Posts: 61
Joined: Thu Dec 12, 2013 1:04 pm
Location: BR BR?
Contact:

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

Post 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").
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

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

Post 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?
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
Satinxs
Prole
Posts: 9
Joined: Thu Jun 14, 2012 4:14 pm

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

Post by Satinxs »

Positive07 wrote:Could you check with logcat?
Will try as soon as possible! Thank you for the help! :)
Locked

Who is online

Users browsing this forum: No registered users and 0 guests