LÖVELINESS a LÖVE Chrome Extension

Discuss any ports of LÖVE to different platforms.
Post Reply
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: LÖVELINESS a LÖVE Chrome Extension

Post by kikito »

binji wrote:I wired up lua's print function to display in the Chrome Developer Tools console.
ARE YOU A WIZARD? (ಥ_ಥ)
When I write def I mean function.
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: LÖVELINESS a LÖVE Chrome Extension

Post by Jasoco »

Is there a way to embed it in a webpage and actually link to a hosted .love file as if it were an embed tag linking to a .swf file? Someone could conceivably create the Löve equivalent to NewGrounds.
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: LÖVELINESS a LÖVE Chrome Extension

Post by T-Bone »

Jasoco wrote:Is there a way to embed it in a webpage and actually link to a hosted .love file as if it were an embed tag linking to a .swf file? Someone could conceivably create the Löve equivalent to NewGrounds.
If nothing else, that would be really handy here on the forums, especially here in the Projects and Demos section.
User avatar
clofresh
Citizen
Posts: 87
Joined: Sun Jul 26, 2009 4:21 pm
Contact:

Re: LÖVELINESS a LÖVE Chrome Extension

Post by clofresh »

Jasoco wrote:Is there a way to embed it in a webpage and actually link to a hosted .love file as if it were an embed tag linking to a .swf file?
Iframes work! http://www.syntacticbayleaves.com/love.html
----------------------------------------
Sluicer Games
User avatar
hryx
Party member
Posts: 110
Joined: Mon Mar 29, 2010 2:28 am
Location: SF<CA<USA

Re: LÖVELINESS a LÖVE Chrome Extension

Post by hryx »

This is great. My nitpick: The name "LÖVELINESS" wasn't searchable in the Chrome web store by typing loveliness, nor did Google show it for the search site:love2d.org loveliness.

Also, this did not work for me in Chromium on Linux Mint 12, despite turning on the NaCl flag. I can send more information if it will help you.

Edit: two more things.
- How are you going to handle LÖVE version compatibility?
- What are you going to do with the "quit" event? I hit "escape" in the particle demo and it bluescreened (but that's probably because the quit event API was changed since this old demo).
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: LÖVELINESS a LÖVE Chrome Extension

Post by kikito »

hryx wrote:This is great. My nitpick: The name "LÖVELINESS" wasn't searchable in the Chrome web store by typing loveliness, nor did Google show it for the search site:love2d.org loveliness.
I concur with that nitpick. I hereby suggest using the repo name: love-nacl. True, it's not as "funny" as LÖVELINESS, but it's searchable, easier to remember and type, and already being used by the repo anyway.
When I write def I mean function.
User avatar
binji
Prole
Posts: 32
Joined: Fri Apr 26, 2013 9:43 am
Contact:

Re: LÖVELINESS a LÖVE Chrome Extension

Post by binji »

clofresh wrote:Iframes work!
I wouldn't rely on that just yet. Not sure if that's by design...
hryx wrote:The name "LÖVELINESS" wasn't searchable in the Chrome web store by typing loveliness, nor did Google show it for the search site:love2d.org loveliness.
Hm. But I like it...! I've added loveliness to the description on the CWS, I'll see if that helps searchability. Also, your post shows up now when I search for "loveliness love2d"! Not perfect, but it'll do. :P
hryx wrote:Also, this did not work for me in Chromium on Linux Mint 12, despite turning on the NaCl flag.
Can you file a bug here? If not, just PM me with the details. Also type "about:version" into Chrome and copy the data from there into the bug.
hryx wrote:How are you going to handle LÖVE version compatibility?
Good question. The easiest solution, I think, is to build different love binaries into the extension, and run the correct one at runtime. This will make the extension bigger, but won't require rewriting any code. I'm not very interested in doing that right now, though.
hryx wrote:What are you going to do with the "quit" event?
I have an outstanding bug to do something more clever on exit. I think the nicest thing would be to close the tab, so I'll probably do that. It should be easy to support the "q" message as well -- though I'm hesitant to add features like that. If it fails in desktop love, it should fail in LÖVELINESS! (and the other way around too, but that's harder. :D )
[[LÖVE Chrome Extension]]
LÖVELINESS
Examples page
Github project page
User avatar
hryx
Party member
Posts: 110
Joined: Mon Mar 29, 2010 2:28 am
Location: SF<CA<USA

Re: LÖVELINESS a LÖVE Chrome Extension

Post by hryx »

binji wrote:Hm. But I like it...! I've added loveliness to the description on the CWS, I'll see if that helps searchability. Also, your post shows up now when I search for "loveliness love2d"! Not perfect, but it'll do. :P
Not if you want good exposure and a strong web identity! I like the name too, but Kikito's suggestion would be more practical: loveliness may mean a million things to Google, while love-nacl would only mean one.
binji wrote:Can you file a bug here?
Here ya go. Let me know if I can provide testing or more info.
binji wrote:I think the nicest thing would be to close the tab
I'm not so sure about that. Let's say I'm on your examples page and play a demo. Then I press escape -- the tab closes. Now I have to search for your site again (pretend I don't know about "undo close tab"). An alternative might be to show a "Game finished" screen with:
- Link back to originating page
- Option to re-launch game
- Link to download .love file

Imagine an HTML5 game closing your tab without you explicitly telling it to do so. It wouldn't be what you were expecting.
binji wrote:It should be easy to support the "q" message as well -- though I'm hesitant to add features like that. If it fails in desktop love, it should fail in LÖVELINESS! (and the other way around too, but that's harder. :D )
Like I said, the 'q' event is from an older version of LOVE, which is now love.event.quit. So I agree that you should really let LOVE handle it as it would -- in this case, bluescreen on love.event.push('q') -- presuming the extension is loading LOVE v0.8 and not an older one.

in any case, you should host some demos/games made for v0.8+ (or update the .love sources of the current ones)!
User avatar
SiENcE
Party member
Posts: 792
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany
Contact:

Re: LÖVELINESS a LÖVE Chrome Extension

Post by SiENcE »

Cool. Our gamejam game 'FOUR' runs on LÖVELINESS :).

Image
http://gamejams.schattenkind.net/2012/11/four.html

I updated our whole webite. Only shaders make problems.
User avatar
binji
Prole
Posts: 32
Joined: Fri Apr 26, 2013 9:43 am
Contact:

Re: LÖVELINESS a LÖVE Chrome Extension

Post by binji »

hryx wrote:Not if you want good exposure and a strong web identity! ...
I'll consider it. :)
hryx wrote:
binji wrote:I think the nicest thing would be to close the tab
I'm not so sure about that.
Of course you're right, I always run by middle-clicking to open in a new tab, so closing the tab made the most sense to me. If you're still in the same tab, that would be bad.

On a related note: currently, the extension is acting kinda like a PDF viewer. It treats files with the mimetype "application/x-love-game" as documents it knows how to read. This is really cool, because it "just works". The downside is that I have no control over the page it generates. This means that I can't add JavaScript, manipulate the DOM, etc. This makes some of the features you describe above difficult.

I have some thoughts on how to work around this:
1) Adding a context menu: This will open in a new tab that I have full control of. Downside: left-clicking just downloads.
2) Modifying the page: Look at the page, try to find links to .love files, and change them to load the extension. Downside: Lots of problems with this solution... hard to detect links, ugly to modify the page, etc.
3) Read the page, create a popup with links: Same as #2, but create a little popup using a page/browser action (the little icon in the upper-right).
4) Load in new tab, redirect current tab: I can basically do what I'm doing now, only create a new tab to load the .love file. The trick is that the current page is still trying to navigate somewhere, and I can't tell it to stop -- so I think the best I can do is redirect it back to the current page. I have to experiment with this to see if it will actually work...
5) ...?
hryx wrote:in any case, you should host some demos/games made for v0.8+ (or update the .love sources of the current ones)!
Any suggestions?
[[LÖVE Chrome Extension]]
LÖVELINESS
Examples page
Github project page
Post Reply

Who is online

Users browsing this forum: No registered users and 52 guests