Difference between revisions of "Lua API:Platform"

From The Powder Toy
Jump to: navigation, search
(Added platform page)
 
m (Add to lua category)
 
Line 68: Line 68:
 
  nil plat.clipboardPaste(string text)
 
  nil plat.clipboardPaste(string text)
 
"Pastes" text to clipboard
 
"Pastes" text to clipboard
 +
 +
[[Category:Lua]]

Latest revision as of 05:15, 15 December 2024

Methods

platform.platform

string plat.platform()

Returns the platform that the game's executable is compiled for.

Possible return values:

  • WIN64
  • WIN32
  • LIN64
  • LIN32
  • MACOSARM
  • MACOSX
  • UNKNOWN

platform.ident

string plat.ident()

Returns the target triplet for the game's executable containing the CPU family, the OS name and C environment separated by dashes

Possible return values:

  • For CPU family: [1]
  • For OS name: [2]
  • For C environment:
    • msvc
    • mingw
    • macos
    • bionic
    • gnu


platform.build

string plat.build()

THIS FUNCTION IS DEPRECATED

Possible return values:

  • SSE3
  • SSE2
  • SSE
  • NO


platform.releaseType

string plat.releaseType()

Returns the game's executable release type.

Possible return values:

  • R (Release)
  • B (Beta)
  • S (Snapshot)

platform.exeName

string plat.exeName()

Returns the path to the game's executable.

platform.restart

nil plat.restart()

Restarts the game

platform.openLink

nil plat.openLink(string URI)

Opens the provided link in the default system browser.

platform.clipboardCopy

string plat.clipboardCopy()

"Copies" or returns text from clipboard

platform.clipboardPaste

nil plat.clipboardPaste(string text)

"Pastes" text to clipboard