Hi,
I'm currently developing a little lua editor for iOS, and I would make it possible to launch our LÖVE games directly from within the app. To be able to do this, I must reset the game context and start a new UIViewController that hosts a new game instance with updated code.
Have you any clue on how to achieve such a thing ?
Thanks !
Creating game view on iOS
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- aloisdeniel
- Prole
- Posts: 17
- Joined: Sat Jan 30, 2016 5:57 pm
- Contact:
Creating game view on iOS
My LÖVE libraries : pixelatlas, pixelmap
Re: Creating game view on iOS
You can try
That'll load the file and if it's a valid main file, that'll overwrite existing game state.
Code: Select all
require ( "main.lua" )
- Positive07
- Party member
- Posts: 1014
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: Creating game view on iOS
Umm, pretty sure that should be
Without the Lua extension
Code: Select all
require "main"
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
- aloisdeniel
- Prole
- Posts: 17
- Joined: Sat Jan 30, 2016 5:57 pm
- Contact:
Re: Creating game view on iOS
Okay thanks guys!
That's a good starting point, but this will not prevent to have a full-screen app with game running at startup. I would like to start the game from my existing iOS app : imagine a button that would trigger the game launch for example.
That's a good starting point, but this will not prevent to have a full-screen app with game running at startup. I would like to start the game from my existing iOS app : imagine a button that would trigger the game launch for example.
My LÖVE libraries : pixelatlas, pixelmap
- slime
- Solid Snayke
- Posts: 3161
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Creating game view on iOS
LOVE's source already has code to do something like that, you can probably modify it or use it as an example to do what you want:
https://bitbucket.org/rude/love/src/aa7 ... ios.mm-205
It gets run as part of initialization in the C main() before the Lua instance is started:
https://bitbucket.org/rude/love/src/aa7 ... ove.cpp-74
https://bitbucket.org/rude/love/src/aa7 ... ios.mm-205
It gets run as part of initialization in the C main() before the Lua instance is started:
https://bitbucket.org/rude/love/src/aa7 ... ove.cpp-74
- aloisdeniel
- Prole
- Posts: 17
- Joined: Sat Jan 30, 2016 5:57 pm
- Contact:
Re: Creating game view on iOS
It seems very interesting, thanks slime!
I'll dig into this code and let you know if I achieved what I want!
I'll dig into this code and let you know if I achieved what I want!
My LÖVE libraries : pixelatlas, pixelmap
Who is online
Users browsing this forum: Ahrefs [Bot], Amazon [Bot], Semrush [Bot] and 3 guests