How to add https to love.js

Discuss any ports of LÖVE to different platforms.
Post Reply
User avatar
Gunroar:Cannon()
Party member
Posts: 1150
Joined: Thu Dec 10, 2020 1:57 am

How to add https to love.js

Post by Gunroar:Cannon() »

It seems like something that would be easy to do but I have trouble doing. I'm using Makelove to make the project, and luahttps as a native file won't work with web, but I believe is should be able to somehow allow Lua to make https calls.
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
User avatar
dusoft
Party member
Posts: 765
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: How to add https to love.js

Post by dusoft »

I think the support is going to be included in v12.
User avatar
Gunroar:Cannon()
Party member
Posts: 1150
Joined: Thu Dec 10, 2020 1:57 am

Re: How to add https to love.js

Post by Gunroar:Cannon() »

Yes, I know. And I've also successfully built versions without needing 12. I was asking AI and it said that I had to expose a module variable that can call the API in a script tag of the html file, to Lua.
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
User avatar
Gunroar:Cannon()
Party member
Posts: 1150
Joined: Thu Dec 10, 2020 1:57 am

Re: How to add https to love.js

Post by Gunroar:Cannon() »

like it how isn't there a way to expose javascript functions or variables to the global namespace lua for love.js somehow?
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
User avatar
Gunroar:Cannon()
Party member
Posts: 1150
Joined: Thu Dec 10, 2020 1:57 am

Re: How to add https to love.js

Post by Gunroar:Cannon() »

I'm away from my coding environment right now, but here's how AI said I could go about it:

Code: Select all

// Exposing a JavaScript function to Lua
lovejs.bindGlobal("myJsFunction", function() {
    console.log("This is a JavaScript function!");
    return "Hello from JavaScript!";
});
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
Xugro
Party member
Posts: 115
Joined: Wed Sep 29, 2010 8:14 pm

Re: How to add https to love.js

Post by Xugro »

You need to use another library. The Love.js-Api-Player does what you need. It also has an example and tips for using it with Davidobot love.js fork, that makelove is using.
Post Reply

Who is online

Users browsing this forum: Amazon [Bot] and 0 guests