love-android: discussion

A project to port LÖVE to Android handhelds
Locked
User avatar
kraftman
Party member
Posts: 277
Joined: Sat May 14, 2011 10:18 am

Re: love-android

Post by kraftman »

As above, I can't seem to get printing to work, it instead outputs white squares. should I set a font first?

Is there a list of which parts of the love API are currently working?

Thanks for this guys, its excellent!
User avatar
ghoulsblade
Party member
Posts: 111
Joined: Sun Oct 31, 2010 6:11 pm

Re: love-android

Post by ghoulsblade »

font bug on devices is known, works in emu, we're working on it.
list of supported api : no function-by-function list, but see "done" and "not yet working " sections on
http://ghoulsblade.schattenkind.net/wik ... 2d-android

print : yeah, hard without setting up the android sdk and debugging via one of the commandline things + usb cable.
maybe this thread is interesting ? didn't try it yet, but seems it shows console output stuff onscreen :
"Debug - A whole new way of debugging your game" http://love2d.org/forums/viewtopic.php?f=5&t=2473
love-android - gamejams
User avatar
miko
Party member
Posts: 410
Joined: Fri Nov 26, 2010 2:25 pm
Location: PL

Re: love-android

Post by miko »

ghoulsblade wrote:font bug on devices is known, works in emu, we're working on it.
OK, thanks for the update.
ghoulsblade wrote: print : yeah, hard without setting up the android sdk and debugging via one of the commandline things + usb cable.
maybe this thread is interesting ? didn't try it yet, but seems it shows console output stuff onscreen :
"Debug - A whole new way of debugging your game" http://love2d.org/forums/viewtopic.php?f=5&t=2473
I tried exactly this idea, but without working love.graphics.print() it will not work. Besides, print() is important for communication with a user - you cannot usually create an image for every message...

What about network support? Is it even considered?
My lovely code lives at GitHub: http://github.com/miko/Love2d-samples
User avatar
ghoulsblade
Party member
Posts: 111
Joined: Sun Oct 31, 2010 6:11 pm

Re: love-android

Post by ghoulsblade »

debug/love.graphics.print : yeah, i hope i can fix it this weekend. you couuuuuuld make 26+10 small images a-z0-9 and override love.graphics.print to draw sprites if you're impatient XD

network : from what i hear internet connections on smartphones are rather unstable,
so don't count on it for "realtime" gameplay too much (turnbased/delay stuff might work),
wlan might be better tho.

it's on the todo, so considered yes, but i haven't looked at the api yet.
first some sensor stuff then the font fix i guess ^^
love-android - gamejams
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: love-android

Post by TechnoCat »

T-Bone wrote:I know it's possible for apps to overwrite the functionality of the physical buttons on Android devices. The optimal solution to this would be that love.keyboard (and of coure love.keypressed and so on) would register the keys "home", "menu", "search" and so on, and, if they're used in a game, the standard functionality of those buttons would be overwritten (but not otherwise). This is probably a pain to implement as you'd have to look through the source of the lua files in order to know if the buttons are used or not. A simpler soultion would perhaps be to have a function or a table that let's the user specify what physical buttons he or she wants love.keyboard to recognize. For example, if a table was used, it could be something like this
Why not invent new callbacks for each system button?
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: love-android

Post by T-Bone »

TechnoCat wrote:
T-Bone wrote:I know it's possible for apps to overwrite the functionality of the physical buttons on Android devices. The optimal solution to this would be that love.keyboard (and of coure love.keypressed and so on) would register the keys "home", "menu", "search" and so on, and, if they're used in a game, the standard functionality of those buttons would be overwritten (but not otherwise). This is probably a pain to implement as you'd have to look through the source of the lua files in order to know if the buttons are used or not. A simpler soultion would perhaps be to have a function or a table that let's the user specify what physical buttons he or she wants love.keyboard to recognize. For example, if a table was used, it could be something like this
Why not invent new callbacks for each system button?
That's a possibility. There are a few issues that might have solutions:
1. Inconsistent with other physical buttons
2. lots of functions (keypressed, keyreleased, and isDown for every button)
3. not trivial to check if a function has been overwritten or not in order to know if it should overwrite the standard key functionality
User avatar
ghoulsblade
Party member
Posts: 111
Joined: Sun Oct 31, 2010 6:11 pm

Re: love-android

Post by ghoulsblade »

when lua code in the .love wants to override default behavior of a button it could just do "return true" in the keypressed callback i suppose =)
e.g.

Code: Select all

function love.keypressed(key)
  if (key == "phone_home") then 
    print("home pressed, overriding...")
    return true
  end 
end
i'll check this weekend if it's technically possible via android api to override / disable their default behavior.
love-android - gamejams
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: love-android

Post by T-Bone »

ghoulsblade wrote:when lua code in the .love wants to override default behavior of a button it could just do "return true" in the keypressed callback i suppose =)
e.g.

Code: Select all

function love.keypressed(key)
  if (key == "phone_home") then 
    print("home pressed, overriding...")
    return true
  end 
end
i'll check this weekend if it's technically possible via android api to override / disable their default behavior.
I know that it is possible, at the very least for the menu button. I'm not sure how you do it though.
User avatar
ghoulsblade
Party member
Posts: 111
Joined: Sun Oct 31, 2010 6:11 pm

Re: love-android

Post by ghoulsblade »

devnews: http://ghoulsblade.schattenkind.net/lov ... ndroid.apk
fontfix 1, still doesn't work in "in your face city trains", but at least i get a text now when using a mini main.lua :

Code: Select all

function love.load () end
function love.draw () 
	love.graphics.print(" abcdefghijklmnopqrstuvwxyz0123456789.!'-:·",10,10)
end
function love.update () end
love-android - gamejams
User avatar
ghoulsblade
Party member
Posts: 111
Joined: Sun Oct 31, 2010 6:11 pm

Re: love-android

Post by ghoulsblade »

devnews: http://ghoulsblade.schattenkind.net/lov ... ndroid.apk
changed geometry generation for font a bit to avoid reallocating the buffer and give a different size in case of spaces,
also made the default font white rather than black and power of two.
It seems to work for power-of-2 texture sizes now. see attached .love file :
fonttest.love
(2.14 KiB) Downloaded 93 times
should display 3 lines with different font,
1) default font in white (works correctly on my milestone)
2) non-power-of-2 image font in black (316x6) (i only get white boxes on my milestone)
3) power-of-2 (512x8) image font in red (works correctly on my milestone)
4) non-power-of-2 image used for the font (316x6) (i only get a big white box on my milestone)
love-android - gamejams
Locked

Who is online

Users browsing this forum: No registered users and 6 guests