License from €75 Log in
DE EN FR ES IT CZ

Detect on which platform you are running. (PC/moblie/Playstation/ect)

This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials

  1. · 9 years ago
    Hi there,

    i play around with the different platforms we can export for...
    So as the title suggest we need some kind of detection on which platfrom we are to provide the right kind of "input interface". For example i compiled a Andriod version today and have no right click... an easy soulution would be to provide a verbcoin on Andriod, but i don´t want this for PC.. and as you guess the list goes on.
    So is there any function to detect the platform the programm is running?
    (if not there should be!) wink

    thanks!
  2. Working on a game?

    The free version covers up to 25 scenes per project. For more scenes and to sell your game, you need a license.

    See licenses Try it for free
  3. · 9 years ago
    Hi stothew,

    use the getProperty Lua function to set some conditions. See here:

    kind regards
    Sebastian
  4. · 9 years ago
    Actually, there is already a system in place for that. wink

    getProperty(name)

    1. “string” - The requested property to retrieve.
    2. Currently supported properties:
    3. “platform” (win,mac,ios,android,linux,ps4,xbox1,html5)
    4. “steam_initialized” (true/false depending if the steam_api was loaded and client is connected, false if the operation failed)
    5. “galaxy_initialized” (true/false depending if the gog galaxy_api was loaded and client is connected, false if the operation failed)
    6. “galaxy_ready” (true if the galaxy_api is ready)
    7. “system_language” Returns English name of system language or “unknown” if language could not be retrieved.
    8. “display_resolution” Returns the rect that is drawn in, subtracting the black borders

    -- if platform equals windows then do some action else if mac do some other action
    if getProperty("platform") == "win" then
      Conditions["win"].Value = true
    elseif getProperty("platform") == "mac" then
      Conditions["mac"].Value = true
    end
    
  5. · 9 years ago
    Don't seem to be able to edit my post to add a new line after the code block to add an edit note to say Sebastian beat me to it, though the wiki page is out of date. I took the information from Simon's luadocs api page instead.
  6. · 9 years ago
    this is great! thanks a lot.

This thread is closed because nobody has replied for more than a year. Feel free to ask your question in a new thread.

New thread

Really delete this post?