Will there be a iPad version LÖVE?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Will there be a iPad version LÖVE?

Post by Jasoco »

Robin wrote:Hm, programming on the iPad? It should be possible, but having to use the on-screen keyboard makes it pretty much impossible to do actual work on it.
Not necessarily. But it would be less easy. But all the characters should be there. And there are nice iPad text editors out there. But I would probably prefer having the iPad/iPod/iPhone version of Löve utilize iOS/iTunes' "File Sharing" feature where it allows you to upload any file you want to an apps "sandbox". For Löve, it could be .love projects. Either zipped or just renamed folders. Then Löve could have a menu that shows up on launch if there's more than one project to choose from.

That is when it's actually created. I'd kill for a prototype. I'd even Jailbreak my iPad. (When I get it... hopefully this week.. oh I want it soooo much... and I don't know why!)

And don't forget to let iPad versions of projects take full advantage of multi-touch. (Even if it doesn't get implemented for a while) And none of that "Oh, we need the projects to remain cross-platform" bullpoop. Something tells me if someone's going to make a project for an iPad, or a Canoo or whatever it's called, they're going to want to take advantage of everything the platform offers. That means multi-touch on iPads so we can make our own on-screen controllers or whatever. Just copy iOS Safari's JavaScript "multitouch" implementation where it just accepts each "touch" point down as a new touch and when released it removes it as a point.

Place one finger down > Touch 1 start
Place second finger down > Touch 2 start
Remove finger one > Touch 1 ended but Touch 2 still active

There'd be love.touchStart(x,y,e) where e is the ID of the current touch. And love.touchEnd(e). When a touch is started, you'd place it into a table of X and Y's for each finger (I guess up to however many the iPad supports) so it'd be like:

Code: Select all

function love.touchStart(x,y,e)
  touch[e].x = x
  touch[e].y = y
  touch[e].active = true
end

function love.touchEnd(e)
  touch[e].active = false
end

function love.update(dt)
  for i, t in pairs(touch)
    if t.active then
      --DO STUFF HERE WITH THE t.x and t.y for each finger
    end
  end
end
Or whatever. That's just an example. And I've spent so much time on it.

Leave the rest up to the coder. Someone'll probably create a library to help with this in time and it'll probably have a funny dirty name of course. Like "fingëred löve" or something.

To get even more elaborate, like if you have special places on screen defined as buttons, you'd check if the X and Y are inside the box at finger down and if so, make the button active. And when released, the button would become inactive through the magic of coding.

Say:

Code: Select all

function touchStart(x,y,e)
  if x and y are inside button 1 then --Okay, this line is pseudocode of course
    button[1].pressed = true
    touch[e].button = 1          --This would attach the button to the finger so when we release it, we know which button to release
  end
end

function touchEnd(e)
  if touch[e].button ~= nil then
    button[touch[e].button].pressed = false
  end
end

function love.update(dt)
  for i, b in pairs(button) do
    if b.pressed then
      --DO STUFF HERE OF COURSE!!!
    end
  end
end
Of course, this could be done differently by using the first example a different way, but you get the idea. And now I have posted a dream that isn't real once again and have depressed myself. Like all those idiots that watched Avatar and killed themselves because they couldn't live on Pandora.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Will there be a iPad version LÖVE?

Post by Robin »

Jasoco wrote:Not necessarily. But it would be less easy. But all the characters should be there.
My dad has an iPad. It is a pain in the ass to type even search queries, let alone entire files.
Jasoco wrote:oh I want it soooo much... and I don't know why!
That's Steve Jobs, turning your brain to mush. :P
Jasoco wrote:That means multi-touch on iPads so we can make our own on-screen controllers or whatever. Just copy iOS Safari's JavaScript "multitouch" implementation where it just accepts each "touch" point down as a new touch and when released it removes it as a point.
Hm, I think that could be done with love.mousepressed and love.mousereleased, perhaps giving an integer as the "button" argument?
Jasoco wrote:And now I have posted a dream that isn't real once again and have depressed myself. Like all those idiots that watched Avatar and killed themselves because they couldn't live on Pandora.
<Something witty about Apple and Steve Jobs being similar to Avatar in some way.>
Help us help you: attach a .love.
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Will there be a iPad version LÖVE?

Post by Jasoco »

Robin wrote:Hm, I think that could be done with love.mousepressed and love.mousereleased, perhaps giving an integer as the "button" argument?
Better idea. Would it treat each finger as a button. Instead of "l" and "r" it'd be what, "f1", "f2", "f3", etc? Or would it be an integer number for each finger?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Will there be a iPad version LÖVE?

Post by Robin »

Jasoco wrote:Would it treat each finger as a button. Instead of "l" and "r" it'd be what, "f1", "f2", "f3", etc? Or would it be an integer number for each finger?
I'd say the latter, since it's probably more natural that way. Plus, it would be very simple to distinguish between actual mouse buttons and multi-touch:

Code: Select all

if type(button) == 'number' then
 -- multi-touch blah
else
 -- mouse blah
end
I don't know what would be the best way to represent moving fingers, though. I have some ideas, but they are all sufficiently hackish that it would be best not to discuss them at all.
Help us help you: attach a .love.
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Will there be a iPad version LÖVE?

Post by Jasoco »

Robin wrote:
Jasoco wrote:Would it treat each finger as a button. Instead of "l" and "r" it'd be what, "f1", "f2", "f3", etc? Or would it be an integer number for each finger?
I'd say the latter, since it's probably more natural that way. Plus, it would be very simple to distinguish between actual mouse buttons and multi-touch:

Code: Select all

if type(button) == 'number' then
 -- multi-touch blah
else
 -- mouse blah
end
I don't know what would be the best way to represent moving fingers, though. I have some ideas, but they are all sufficiently hackish that it would be best not to discuss them at all.
All the finger X and Y's would just be in an array. Like how there's love.mouse.getX() there'd be something like love.touch.getX(id) which would return nil if the touch point is not active.

You'd just loop through all the available ones up to the maximum Löve will support. (Say, 5 or 10. The iDevices can detect quite a few as can the MacBook trackpad which can detect at least 11.)
User avatar
bmelts
Party member
Posts: 380
Joined: Fri Jan 30, 2009 3:16 am
Location: Wiscönsin
Contact:

Re: Will there be a iPad version LÖVE?

Post by bmelts »

Here's how Apple's touch API works.

There are four callback methods that get delivered when something receives touches: touchesBegan, touchesMoved, touchesEnded, and touchesCancelled. Each of these passes an unordered set of touch objects that can be checked for position and things like that.

Any LÖVE touch API would need to work with Apple's system.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Will there be a iPad version LÖVE?

Post by Robin »

Well, that sucks. Can't LÖVE provide these details themselves? Extract them from the data its given? Because I'm afraid its going to be an unlovely API if we do it the Apple way.
Help us help you: attach a .love.
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Will there be a iPad version LÖVE?

Post by Jasoco »

Well, obviously. It's not like the device can tell your fingers apart. Löve would just add each finger to the table in the order they're received.

Does it at least know the X and Y and which touch event was "ended"? Shouldn't be that hard from the Löve programmer's point of view. Don't know how it will be from the people writing Löve itself.
hengying
Prole
Posts: 5
Joined: Sat Dec 11, 2010 2:33 am

Re: Will there be a iPad version LÖVE?

Post by hengying »

hengying wrote:Love the LÖVE engine very much!
Will there be a iPad version LÖVE?
Then we can do program in LÖVE at any time, any place.
Waiting for "the great developing environment"!
There is already a app called "Codify" on iPad, it's a Lua game engine and a developing env.
why not Love 2d?
User avatar
bmelts
Party member
Posts: 380
Joined: Fri Jan 30, 2009 3:16 am
Location: Wiscönsin
Contact:

Re: Will there be a iPad version LÖVE?

Post by bmelts »

Codify looks pretty awesome, but it suffers from a few major limitations - for example, no sharing or exporting your code, due to Apple's restrictions. You can write cool stuff, I'm sure, but it's basically constrained to your particular iPad. That said, it's an awesome project and I hope to see more like it.

As long as we're talking about Codify, I should mention that the devs like us! :ultrahappy:
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 59 guests