RealityChip

RealityChip

The RealityChip lets you read some values about real-world usage of your computer from inside Retro Gadgets.

Properties

Cpu.TotalUsage number read only

The total CPU usage of the system, from 0 to 100.

Cpu.CoresUsage {number} read only

An array that contains the CPU usage of each logical CPU core, from 0 to 100.

Ram.Available number read only

Available RAM expressed in MB.

Ram.Used number read only

Used RAM expressed in MB.

Network.TotalSent number read only

Total sent by network interfaces expressed in Mbps.

Network.TotalReceived number read only

Total received from network interfaces expressed in Mbps.

LoadedAssets Asset read only

Array containing all the assets currently loaded from the Documents/My Games/Retro/UserData folder.

Methods

GetDateTime( ) {}

Returns a table containing the current local date and time.
The values in the table are:
* year
* month
* day
* yday (year day)
* wday (week day)
* hour
* min
* sec
* isdst (is daylight saving time)

GetDateTimeUTC( ) {}

Returns a table containing the current local date and time expressed as the Coordinated Universal Time (UTC).
The values in the table are:
* year
* month
* day
* yday (year day)
* wday (week day)
* hour
* min
* sec
* isdst (is daylight saving time)

LoadAudioSample( filename string ) AudioSample

Load an AudioSample asset from an audio file.
The file must be in Documents/My Games/Retro/UserData, filename represents the relative path.

LoadSpriteSheet( filename string, spritesWidth number, spritesHeight number ) SpriteSheet

Load a SpriteSheet asset from an image file.
The file must be in Documents/My Games/Retro/UserData, filename represents the relative path.

UnloadAsset( filename string )

Unload a previously loaded asset.
Remove it from LoadedAssets and make it invalid.

ListDirectory( directory string ) string[]

Returns the list of files and folders contained in the specified folder.
The directory must be in Documents/My Games/Retro/UserData, the directory parameter represents the relative path.

GetFileMetadata( filename string ) {}

Returns a table containing information about the file without the need to load it.
The file must be in Documents/My Games/Retro/UserData, filename represents the relative path.