Core API Reference: System
From Color Infection Wiki
Contents |
Get Program Milliseconds
Return the number of milliseconds since the level has loaded.
Input Parameters:
- (none)
Output Parameters:
- Milliseconds
- (number) the number of milliseconds since the level loaded
Get Current Date Time
Return the current date and time.
Input Parameters:
- UTC (universal time)?
- (boolean) true to return the UTC time, false to return the local time
Output Parameters:
- Year
- (number) current year
- Month
- (number) current month
- Day
- (number) current day
- Hours
- (number) current hours, from 0 to 23
- Minutes
- (number) current minutes
- Seconds
- (number) current seconds
- Milliseconds
- (number) current milliseconds, from 0.0 to 1000.0
Get Day In Week
Return the number day of the week.
Input Parameters:
- UTC (universal time)?
- (boolean) true to return the UTC time, false to return the local time
Output Parameters:
- Day In Week
- (number) the day in the week, 0 for sunday
Get Time Zone
Return the time zone of the player
Input Parameters:
- (none)
Output Parameters:
- The Time Zone
- (number) a value from -12 to +12; 0 is GST
Is Key Held?
Return a Boolean for if a specific key is being held down.
Input Parameters:
- The Key
- (number, ID) the specified key
Output Parameters:
- Is Hold?
- (boolean) the hold status of the specified key
Is Mouse Button Hold?
Return a Boolean for if the left mouse button is being held down.
Input Parameters:
- (none)
Output Parameters:
- Hold?
- (boolean) the hold status of the left mouse button
Set Mouse Visible
Set the visibility of the mouse.
Input Parameters:
- Visible?
- (boolean) visible or not
Output Parameters:
- (none)
Is Accelerometer Supported?
Check whether accelerometer is supported or not. Generally, on PC, false will be returned. But for mobile devices, true will be returned.
Input Parameters:
- (none)
Output Parameters:
- Supported?
- (boolean) whether accelerometer is supported or not
Get Acceleration
If accelerometer is supported, return the current acceleration detected by the accelerometer, otherwise, return (ax=0.0, ay=1.0, az=0.0). The returned acceleration doesn't include the gravity acceleration. A value of 1.0 means 1g or 1m/s2. X axis is from left to right, y axis is from bottom to top and z axis is from screen back to screen front. So for a mobile phone lying on a table, the return value is (ax=0.0, ay=0.0, az=1.0). For a mobile phone in free dropping, the return value is (ax=0.0, ay=0.0, az=0.0).
Input Parameters:
- (none)
Output Parameters:
- Acceleration X
- x component of the current acceleration
- Acceleration Y
- y component of the current acceleration
- Acceleration Z
- z component of the current acceleration