[Solved] Detect love.js

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
marclurr
Party member
Posts: 112
Joined: Fri Apr 22, 2022 9:25 am

[Solved] Detect love.js

Post 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.
Last edited by marclurr on Wed Sep 13, 2023 7:47 pm, edited 1 time in total.
User avatar
slime
Solid Snayke
Posts: 3144
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Detect love.js

Post by slime »

love.system.getOS will return "Web", I think.
User avatar
marclurr
Party member
Posts: 112
Joined: Fri Apr 22, 2022 9:25 am

Re: Detect love.js

Post 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 :)
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest