Page 1 of 1

[Solved] Detect love.js

Posted: Wed Sep 13, 2023 12:33 pm
by marclurr
Does love.js provide some like an environment variable that says "this is running in love.js"? When building a C/C++ project with emsdk there is a define called __EMSCRIPTEN__, which is useful for when you need to do something slightly different in the web build. I'm wondering if there's something similar for love.js.

Re: Detect love.js

Posted: Wed Sep 13, 2023 4:47 pm
by slime
love.system.getOS will return "Web", I think.

Re: Detect love.js

Posted: Wed Sep 13, 2023 7:47 pm
by marclurr
slime wrote: Wed Sep 13, 2023 4:47 pm love.system.getOS will return "Web", I think.
Yep you're exactly right. Thanks for that :)