Enfusion Script API
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
System Interface Reference

Static Public Member Functions

static proto void MemoryValidation (bool enable)
 Switches memory validation (huge slowdown! Use with care only for certain section of code!)
 
static proto int MemoryAllocationCount ()
 Number of allocations of physical memory.
 
static proto int MemoryAllocationKB ()
 Total allocation of physical memory in kilobytes.
 
static proto bool GetCLIParam (string param, out string val)
 Returns command line argument.
 
static proto bool IsCLIParam (string paramName)
 Returns whether command line parameter is present.
 
static proto string ImportFromClipboard ()
 Copy text from clipboard (works only on PC)
 
static proto void ExportToClipboard (string text)
 Set text to clipboard (works only on PC)
 
static proto string GetProfileName ()
 
static proto string GetMachineName ()
 
static proto int GetUnixTime ()
 Obtain value of SystemTime as number of seconds since midnight 1970-1-1 UTC.
 
static proto void GetHourMinuteSecond (out int hour, out int minute, out int second)
 Returns current system time (real world time) in local timezone.
 
static proto void GetHourMinuteSecondUTC (out int hour, out int minute, out int second)
 Returns current system time (real world time) in UTC.
 
static proto void GetYearMonthDay (out int year, out int month, out int day)
 Returns current system date (real world date) in local timezone.
 
static proto void GetYearMonthDayUTC (out int year, out int month, out int day)
 Returns current system date (real world date) in UTC.
 
static proto ProfileData GetProfileData ()
 
static proto int GetTickCount (int prev=0)
 Returns number of milliseconds that have elapsed since the game was started.
 
static proto string GetAdapterName ()
 
static proto void GetNativeResolution (out int width, out int height)
 
static proto void GetRenderingResolution (out int width, out int height)
 
static proto void GetSupportedResolutions (out notnull array< int > widths, out notnull array< int > heights)
 
static proto void MakeScreenshot (string path)
 Takes screenshot and stores it in a BMP format at specified path.
 
static proto void MakeScreenshotExt (ScreenshotCallback callback, int posX, int posY, int srcWidth, int srcHeight, int dstWidth, int dstHeight)
 Take screenshot on specified position and size.
 
static proto float GetFPS ()
 Returns actual fps (average in last 10 frames)
 
static proto float GetFrameTimeS ()
 Returns average time a frame took in seconds (average over last 10 frames)
 
static proto bool FindFiles (FindFilesCallback callback, string path, string ext)
 Use FileIO.FindFiles instead.
 
static proto EPlatform GetPlatform ()
 Return current platform.
 
static proto bool IsConsoleApp ()
 Checks if the app runs in console mode (no rendering, audio or input)
 

Member Function Documentation

◆ ExportToClipboard()

static proto void System.ExportToClipboard ( string  text)
static

Set text to clipboard (works only on PC)

◆ FindFiles()

static proto bool System.FindFiles ( FindFilesCallback  callback,
string  path,
string  ext 
)
static

Use FileIO.FindFiles instead.

◆ GetAdapterName()

static proto string System.GetAdapterName ( )
static

◆ GetCLIParam()

static proto bool System.GetCLIParam ( string  param,
out string  val 
)
static

Returns command line argument.

Parameters
paramName of a command line argument
[out]valValue of the param or empty string if the param was not found
Returns
True if param is present, False if it was not found
string param;
System.GetCLIParam("world", param); // return a value when program executed with param -world something
Definition: System.c:13
static proto bool GetCLIParam(string param, out string val)
Returns command line argument.

◆ GetFPS()

static proto float System.GetFPS ( )
static

Returns actual fps (average in last 10 frames)

◆ GetFrameTimeS()

static proto float System.GetFrameTimeS ( )
static

Returns average time a frame took in seconds (average over last 10 frames)

◆ GetHourMinuteSecond()

static proto void System.GetHourMinuteSecond ( out int  hour,
out int  minute,
out int  second 
)
static

Returns current system time (real world time) in local timezone.

int hour = 0;
int minute = 0;
int second = 0;
System.GetHourMinuteSecond(hour, minute, second);
Print(hour);
Print(minute);
Print(second);
>> hour = 16
>> minute = 38
>> second = 7
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
static proto void GetHourMinuteSecond(out int hour, out int minute, out int second)
Returns current system time (real world time) in local timezone.

◆ GetHourMinuteSecondUTC()

static proto void System.GetHourMinuteSecondUTC ( out int  hour,
out int  minute,
out int  second 
)
static

Returns current system time (real world time) in UTC.

int hour = 0;
int minute = 0;
int second = 0;
System.GetHourMinuteSecondUTC(hour, minute, second);
Print(hour);
Print(minute);
Print(second);
>> hour = 15
>> minute = 38
>> second = 7
static proto void GetHourMinuteSecondUTC(out int hour, out int minute, out int second)
Returns current system time (real world time) in UTC.

◆ GetMachineName()

static proto string System.GetMachineName ( )
static

◆ GetNativeResolution()

static proto void System.GetNativeResolution ( out int  width,
out int  height 
)
static

◆ GetPlatform()

static proto EPlatform System.GetPlatform ( )
static

Return current platform.

◆ GetProfileData()

static proto ProfileData System.GetProfileData ( )
static

◆ GetProfileName()

static proto string System.GetProfileName ( )
static

◆ GetRenderingResolution()

static proto void System.GetRenderingResolution ( out int  width,
out int  height 
)
static

◆ GetSupportedResolutions()

static proto void System.GetSupportedResolutions ( out notnull array< int widths,
out notnull array< int heights 
)
static

◆ GetTickCount()

static proto int System.GetTickCount ( int  prev = 0)
static

Returns number of milliseconds that have elapsed since the game was started.

◆ GetUnixTime()

static proto int System.GetUnixTime ( )
static

Obtain value of SystemTime as number of seconds since midnight 1970-1-1 UTC.

◆ GetYearMonthDay()

static proto void System.GetYearMonthDay ( out int  year,
out int  month,
out int  day 
)
static

Returns current system date (real world date) in local timezone.

int year = 0;
int month = 0;
int day = 0;
System.GetYearMonthDay(year, month, day);
Print(year);
Print(month);
Print(day);
>> year = 2015
>> month = 3
>> day = 24
static proto void GetYearMonthDay(out int year, out int month, out int day)
Returns current system date (real world date) in local timezone.

◆ GetYearMonthDayUTC()

static proto void System.GetYearMonthDayUTC ( out int  year,
out int  month,
out int  day 
)
static

Returns current system date (real world date) in UTC.

int year = 0;
int month = 0;
int day = 0;
System.GetYearMonthDayUTC(year, month, day);
Print(year);
Print(month);
Print(day);
>> year = 2015
>> month = 3
>> day = 24
static proto void GetYearMonthDayUTC(out int year, out int month, out int day)
Returns current system date (real world date) in UTC.

◆ ImportFromClipboard()

static proto string System.ImportFromClipboard ( )
static

Copy text from clipboard (works only on PC)

◆ IsCLIParam()

static proto bool System.IsCLIParam ( string  paramName)
static

Returns whether command line parameter is present.

Parameters
paramNameName of the command line parameter.
Returns
True if param is present, False otherwise.
if (System.IsCLIParam("verbose")) // Prints "something" when program executed with param -verbose
{
Print("something");
}
static proto bool IsCLIParam(string paramName)
Returns whether command line parameter is present.

◆ IsConsoleApp()

static proto bool System.IsConsoleApp ( )
static

Checks if the app runs in console mode (no rendering, audio or input)

Returns
True if the app runs in console mode. False otherwise.

◆ MakeScreenshot()

static proto void System.MakeScreenshot ( string  path)
static

Takes screenshot and stores it in a BMP format at specified path.

Parameters
pathPath where screenshot should be written. If you use absolute path or $NamedFileSystem: path, it will be used directly without any changes. If you use relative path, it will be relative to $profile: file system. Finally, if path is empty string, screenshot will be saved to "$profile:ScreenShots/DATETIME.bmp" where DATETIME will be replaced by current date and time.

◆ MakeScreenshotExt()

static proto void System.MakeScreenshotExt ( ScreenshotCallback  callback,
int  posX,
int  posY,
int  srcWidth,
int  srcHeight,
int  dstWidth,
int  dstHeight 
)
static

Take screenshot on specified position and size.

dstWidth x dstHeight point to final image size, if they are zero then they equal to srcWidth x srcHeight.

Parameters
scriptCallbackcallback to script function which receives the data
posXX position of screenshot
posYY position of screenshot
srcWidthwidth of image to be taken
srcHeightheight of image to be taken
dstWidthwidth of destination image, 0 means the srcWidth is used
dstHeightheight of destination image, 0 means the srcHeight is used

◆ MemoryAllocationCount()

static proto int System.MemoryAllocationCount ( )
static

Number of allocations of physical memory.

◆ MemoryAllocationKB()

static proto int System.MemoryAllocationKB ( )
static

Total allocation of physical memory in kilobytes.

◆ MemoryValidation()

static proto void System.MemoryValidation ( bool  enable)
static

Switches memory validation (huge slowdown! Use with care only for certain section of code!)


The documentation for this interface was generated from the following file: