Page 1 of 1
How to add https to love.js
Posted: Wed Mar 19, 2025 8:51 am
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.
Re: How to add https to love.js
Posted: Wed Mar 19, 2025 2:04 pm
by dusoft
I think the support is going to be included in v12.
Re: How to add https to love.js
Posted: Wed Mar 19, 2025 5:56 pm
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.
Re: How to add https to love.js
Posted: Thu Mar 20, 2025 10:31 am
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?
Re: How to add https to love.js
Posted: Thu Mar 20, 2025 1:07 pm
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!";
});
Re: How to add https to love.js
Posted: Thu Mar 20, 2025 6:23 pm
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.