[DEPRECATED] Experimental iOS port (LÖVE 0.9.2)

Discuss any ports of LÖVE to different platforms.
User avatar
slime
Solid Snayke
Posts: 3162
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Experimental iOS port (LÖVE 0.9.x)

Post by slime »

T-Bone wrote:Is love.filesystem still untested?
Reading files from the .love always worked. Writing files was broken, but I fixed it (as of a commit a few minutes ago.)

The save directory on iOS is Library/Application Support/identityname/, inside the app's sandbox folder.
User avatar
Ivo
Prole
Posts: 7
Joined: Sat Apr 05, 2014 10:05 pm
Contact:

Re: Experimental iOS port (LÖVE 0.9.x)

Post by Ivo »

slime wrote:I'm not sure - I think this is up to SDL, but looking at its code for creating the keyboard on iOS it has this line: "textField.returnKeyType = UIReturnKeyDefault;" which shouldn't make it go away when pressing the return key.
So do I need to put that line in the LÖVE or SDL code somewhere?
User avatar
slime
Solid Snayke
Posts: 3162
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Experimental iOS port (LÖVE 0.9.x)

Post by slime »

Ivo wrote:So do I need to put that line in the LÖVE or SDL code somewhere?
No, SDL's code already contains that line. I was confused because normally that should make the return button behave like you want, but I dug a little deeper into SDL's iOS code and found this:

Code: Select all

 /* Terminates the editing session */
- (BOOL)textFieldShouldReturn:(UITextField*)_textField
{
    SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_RETURN);
    SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RETURN);
    SDL_StopTextInput();
    return YES;
}
Which is what's causing the text input dialog to always close when return is pressed. Since it's hardcoded into SDL's source, LÖVE can't override it in its own code (and there are situations where you'd want it to auto-close, too.)
User avatar
Ivo
Prole
Posts: 7
Joined: Sat Apr 05, 2014 10:05 pm
Contact:

Re: Experimental iOS port (LÖVE 0.9.x)

Post by Ivo »

slime wrote:
Ivo wrote:So do I need to put that line in the LÖVE or SDL code somewhere?
No, SDL's code already contains that line. I was confused because normally that should make the return button behave like you want, but I dug a little deeper into SDL's iOS code and found this:

Code: Select all

 /* Terminates the editing session */
- (BOOL)textFieldShouldReturn:(UITextField*)_textField
{
    SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_RETURN);
    SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RETURN);
    SDL_StopTextInput();
    return YES;
}
Which is what's causing the text input dialog to always close when return is pressed. Since it's hardcoded into SDL's source, LÖVE can't override it in its own code (and there are situations where you'd want it to auto-close, too.)
If I change the last line

Code: Select all

return YES;
to

Code: Select all

return NO;
would it work like I want it to? Where can I find that line, do I need to download SDL for iOS and edit and compile it and put something in the love folder?
User avatar
slime
Solid Snayke
Posts: 3162
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Experimental iOS port (LÖVE 0.9.x)

Post by slime »

If you comment out the "SDL_StopTextInput();" line (line #303 in src/video/uikit/SDL_uikitview.m in SDL's current source) and recompile SDL for iOS it should work as you want, although I haven't tested it.
User avatar
Ivo
Prole
Posts: 7
Joined: Sat Apr 05, 2014 10:05 pm
Contact:

Re: Experimental iOS port (LÖVE 0.9.x)

Post by Ivo »

slime wrote:If you comment out the "SDL_StopTextInput();" line (line #303 in src/video/uikit/SDL_uikitview.m in SDL's current source) and recompile SDL for iOS it should work as you want, although I haven't tested it.
Thanks! I'll try it when I have the time
User avatar
Ivo
Prole
Posts: 7
Joined: Sat Apr 05, 2014 10:05 pm
Contact:

Re: Experimental iOS port (LÖVE 0.9.x)

Post by Ivo »

It worked perfectly, thanks!
User avatar
xpol
Prole
Posts: 14
Joined: Tue May 13, 2014 2:00 am

Re: Experimental iOS port (LÖVE 0.9.x)

Post by xpol »

I got a bit lag when running the no game in the iOS Simulator.

The sprites move not as smooth as the PC version.
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: Experimental iOS port (LÖVE 0.9.x)

Post by T-Bone »

xpol wrote:I got a bit lag when running the no game in the iOS Simulator.

The sprites move not as smooth as the PC version.
That's probably because it's a simulator. The emulation of iOS hardware on a computer is (somewhat) computationally expensive so it would be strange if it didn't lag. And lag in an emulator does not necessarily mean it will lag on a real device.
User avatar
slime
Solid Snayke
Posts: 3162
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Experimental iOS port (LÖVE 0.9.x)

Post by slime »

The iOS Simulator uses software rendering for OpenGL ES instead of taking advantage of the computer's GPU.
Even though the no-game screen is really simple and no problem for a real GPU, a software renderer will almost always be orders of magnitude slower than hardware rendering, plus the no-game screen involves a lot of blending which is particularly slow for a software renderer.
Locked

Who is online

Users browsing this forum: No registered users and 5 guests