The main namespace for the Lua API elements provided by the Stingray3D engine.
Related sample code
Related help topics
You can use the functions in the DisplayAdapter interface to access the GPUs and outputs (screens) that are connected to the system.
|
The Math object contains some helpful generic math functions.
|
The Network object is the main interface to the system used for playing multiplayer games over the network.
|
The NpCommerceDialog can currently only be used for the PlayStation Plus dialog.
|
The RPC object is used to make remote calls to other connected peers in a networked game.
|
The Script interface contains helper functions for manipulating scripts.
|
Deprecated; use stingray.SimulatedTouchPanel1.
|
Deprecated; use stingray.TouchPanel1.
|
An opaque object returned by several asynchronous functions in the stingray.Cloud interface.
|
References script data obtained from a LevelResource by calling stingray.LevelResource.data() or stingray.LevelResource.unit_data().
|
The GameSession object is responsible for replicating and synchronizing game objects between the peers that participate in a networked game session.
|
A "box" that stores a IdString32Box object across multiple frames.
|
A "box" that stores a IdString64Box object across multiple frames.
|
The LanLobbyBrowser provides access to the list of game lobbies available on the local area network (LAN).
|
An opaque token returned by asychronous functions in the Steam Leaderboard interface.
|
The Localizer is a helper interface that offers access to localized strings that are contained in a single specified .strings resource.
|
A "box" that stores a Matrix4x4 object across multiple frames.
|
The PsnRoomBrowser provides access to the list of game rooms available on the PlayStation Network (PSN).
|
A "box" that stores a Quaternion object across multiple frames.
|
This object allows you to perform collision tests against the physics objects in a PhysicsWorld.
|
RefTracker is a heavy userdata object that you can use to track down memory leaks in Lua.
|
The Replay object can be used to replay events that have occurred in the game world.
|
An opaque object returned by several asynchronous functions in the stingray.SaveSystem interface.
|
These constants may be returned by calls to stingray.Network.clean_sessions_status().
|
The SteamLobbyBrowser provides access to the list of game lobbies available on the Steam.
|
The SteamServerBrowser provides access to the list of game servers available on Steam.
|
Each Unit object represents a single game unit, such as a character, a building, or another object in a game level.
|
The UnitSynchronizer is a helper object that synchronizes the creation, destruction, position and rotation of units across multiple networked peers.
|
A "box" that stores a Vector2 object across multiple frames.
|
A "box" that stores a Vector3 object across multiple frames.
|
A "box" that stores a Vector4 object across multiple frames.
|
This object provides access to functions for controlling sound events for a particular game World.
|
Direction constant returned by the gesture_swipe() function in touch controllers like the TouchPanel1 and TouchPanel2.
|
Achievements ( user ) : stingray.AchievementsThis functions creates an object to enumerate Achievements for the given user.
|
user : | number | The user to enumerate Achievements for. |
The newly created Achievements object. |
actor : | A physics actor to store in the newly created box. |
The newly created box. |
This will allocate new memory, so use this function sparingly. Typically, you should create as many boxes as you will need at any given time in an initialization function, and re-use the same boxes throughout your game whenever you need one.
This function does not accept any parameters. |
The newly created box. |
This will allocate new memory, so use this function sparingly. Typically, you should create as many boxes as you will need at any given time in an initialization function, and re-use the same boxes throughout your game whenever you need one.
AnimationCurves ( resource ) : stingray.AnimationCurvesCreates a new set of animation curves from the specified .animation_curves resource.
|
resource : | string | The animation curves resource to load. |
The newly created animation curve set. |
Broadphase ( cell_radius, num_objects ) : stingray.BroadphaseCreates a new broadphase data structure.
|
cell_radius : | number | The radius of the grid cells. For maximum efficiency, you must set the cell radius to the radius of the largest query you are going to make to the broadphase data structure. The broadphase data structure does not allow you to make queries larger than the cell radius. Moreover, you cannot insert objects larger than the cell radius. |
num_objects : | number | The expected number of objects that can be inserted into the broadphase data structure. This determines how many grid cells are created. |
The newly created broadphase data structure. |
Broadphase objects are garbage collected and do not need to be explicitly destroyed.
Color ( red, green, blue ) : colorReturns a fully opaque color that can be used with the Gui functions.
|
red : | number | The red channel component. |
green : | number | The green channel component. |
blue : | number | The blue channel component. |
Returns an RGB color. |
The parameters can range from 0 to 255. For example:
local orange = stingray.Color(255, 127, 0)
Related sample code
Appkit: /debug_menu.lua Appkit: /debug_scrollbox.lua Appkit: /loading_screen.lua Oculus VR template: /flow_callbacks.lua Oculus VR template: /s3d_ui.lua |
Other related reference items
alpha : | number | The alpha channel component. |
red : | number | The red channel component. |
green : | number | The green channel component. |
blue : | number | The blue channel component. |
Returns an ARGB color. |
The parameters can range from 0 to 255. Note that the first parameter must be the alpha value, which sets the transparency of the color. For example:
local transparent_yellow = stingray.Color(127, 255, 255, 0)
Float32Array ( ) : stingray.Float32ArrayCreates a new empty Float32Array.
|
This function does not accept any parameters. |
The newly created Float32Array data structure. |
IdString32 ( s ) : stingray.IdString32Creates and returns a hashed representation of a string.
|
IdString32Box ( s ) : stingray.IdString32Creates and returns a hashed representation of a string.
|
IdString64 ( s ) : stingray.IdString64Creates and returns a hashed representation of a string.
|
IdString64Box ( s ) : stingray.IdString64Creates and returns a hashed representation of a string.
|
Localizer ( strings ) : stingray.LocalizerCreates a new localizer that will manage access to the strings in the the specified .strings data file.
|
Matrix4x4 ( xx, xy, xz, yx, yy, yz, zx, zy, zz, tx, ty, tz ) : stingray.Matrix4x4Creates a matrix with x-axis (xx, xy, xz), y-axis (yx, yy, yz), z-axis (zx, zy, zz) and translation (tx, ty, tz).
|
xx : | number | The magnitude of the local X axis along the global X axis. |
xy : | number | The magnitude of the local X axis along the global Y axis. |
xz : | number | The magnitude of the local X axis along the global Z axis. |
yx : | number | The magnitude of the local Y axis along the global X axis. |
yy : | number | The magnitude of the local Y axis along the global Y axis. |
yz : | number | The magnitude of the local Y axis along the global Z axis. |
zx : | number | The magnitude of the local Z axis along the global X axis. |
zy : | number | The magnitude of the local Z axis along the global Y axis. |
zz : | number | The magnitude of the local Z axis along the global Z axis. |
tx : | number | The translation along the global X axis. |
ty : | number | The translation along the global Y axis. |
tz : | number | The translation along the global Z axis. |
The newly created matrix. |
Equivalent to Matrix4x4.from_elements().
Matrix4x4Box ( ) : stingray.Matrix4x4BoxCreates a new Matrix4x4Box.
|
This function does not accept any parameters. |
The newly created box. |
This will allocate new memory, so use this function sparingly. Typically, you should create as many boxes as you will need at any given time in an initialization function, and re-use the same boxes throughout your game whenever you need one.
Quaternion ( axis, angle ) : stingray.QuaternionCreates a new Quaternion object that represents a rotation with the specified angle around the specified axis.
|
axis : | The main axis for the quaternion. | |
angle : | number | The angle around the main axis, expressed in radians. |
The newly created quaternion. |
Equivalent to stingray.Quaternion.axis_angle().
QuaternionBox ( x, y, z, w ) : stingray.QuaternionBoxCreates a new QuaternionBox, and stores the specified values in the box.
|
x : | number | The X component value to store in the box. |
y : | number | The Y component value to store in the box. |
z : | number | The Z component value to store in the box. |
w : | number | The W component value to store in the box. |
The newly created box. |
This will allocate new memory, so use this function sparingly. Typically, you should create as many boxes as you will need at any given time in an initialization function, and re-use the same boxes throughout your game whenever you need one.
QuaternionBox ( quat ) : stingray.QuaternionBoxCreates a new QuaternionBox, and stores the specified quaternion in the box.
|
quat : | The quaternion to be stored in the box |
The newly created box. |
This will allocate new memory, so use this function sparingly. Typically, you should create as many boxes as you will need at any given time in an initialization function, and re-use the same boxes throughout your game whenever you need one.
QuaternionBox ( ) : stingray.QuaternionBoxCreates a new QuaternionBox.
|
This function does not accept any parameters. |
The newly created box. |
This will allocate new memory, so use this function sparingly. Typically, you should create as many boxes as you will need at any given time in an initialization function, and re-use the same boxes throughout your game whenever you need one.
RefTracker ( name ) : stingray.RefTrackerCreates a new reference tracker object.
|
name : | string? | Optional. Specifies the name. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
Creates a new RefTracker instance. |
Rotation2D ( pos, angle, pivot ) : rotation2DCreates a matrix that you can use to draw a rotated 2D object using the 3D functions in the Gui.
|
pos : | Specifies the position of an object. | |
angle : | number | The angle in which the object must be rotated (clockwise in radians). |
pivot : | Optional. Specifies the position at which the object must be rotated. If no pivot is specified, the object is rotated around pos. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
You can use this matrix to draw a rotated 2D object using the 3D functions in the Gui. |
Example:
local tm = Rotation2D(Vector2(100,100), angle, Vector2(250,125)) Gui.rect_3d(self.gui, tm, Vector2(0,0), 0, Vector2(300, 50), Color(255,0,0))
Other related reference items
SteamPingThread ( connect ) : stingray.SteamPingThreadCreates a new ping thread that you can use to determine the ping times to other Steam peers.
|
connect : | This can either be the SteamClient or SteamGameServer object used to manage the Steam connection. The any(...) notation indicates that this item may be an instance of any of the types shown in the parentheses. |
The newly created ping thread. |
NOTE: You must call stingray.SteamPingThread.destroy() on the ping thread to destroy it when you are done with it, in order to free the thread. You must do this before shutting down the network.
Vector2 ( x, y ) : stingray.Vector2Creates and returns a new Vector2 object.
|
x : | number | The extent of the vector along the X axis. |
y : | number | The extent of the vector along the Y axis. |
The newly constructed Vector2. |
Vector2Box ( vector ) : stingray.Vector2BoxCreates a new Vector2Box, and stores the specified vector in the box.
|
vector : | The vector to be stored in the box |
The newly created box. |
This will allocate new memory, so use this function sparingly. Typically, you should create as many boxes as you will need at any given time in an initialization function, and re-use the same boxes throughout your game whenever you need one.
Vector2Box ( x, y ) : stingray.Vector2BoxCreates a new Vector2Box, and stores the specified values in the box.
|
x : | number | The X component value to store in the box. |
y : | number | The Y component value to store in the box. |
The newly created box. |
This will allocate new memory, so use this function sparingly. Typically, you should create as many boxes as you will need at any given time in an initialization function, and re-use the same boxes throughout your game whenever you need one.
Vector2Box ( ) : stingray.Vector2BoxCreates a new Vector2Box.
|
This function does not accept any parameters. |
The newly created box. |
This will allocate new memory, so use this function sparingly. Typically, you should create as many boxes as you will need at any given time in an initialization function, and re-use the same boxes throughout your game whenever you need one.
Vector3 ( x, y, z ) : stingray.Vector3Creates and returns a new Vector3 object.
|
x : | number | The extent of the vector along the X axis. |
y : | number | The extent of the vector along the Y axis. |
z : | number | The extent of the vector along the Z axis. |
The newly constructed Vector3. |
Vector3Box ( x, y, z ) : stingray.Vector3BoxCreates a new Vector3Box, and stores the specified values in the box.
|
x : | number | The X component value to store in the box. |
y : | number | The Y component value to store in the box. |
z : | number | The Z component value to store in the box. |
The newly created box. |
This will allocate new memory, so use this function sparingly. Typically, you should create as many boxes as you will need at any given time in an initialization function, and re-use the same boxes throughout your game whenever you need one.
Vector3Box ( vector ) : stingray.Vector3BoxCreates a new Vector3Box, and stores the specified vector in the box.
|
vector : | The vector to be stored in the box |
The newly created box. |
This will allocate new memory, so use this function sparingly. Typically, you should create as many boxes as you will need at any given time in an initialization function, and re-use the same boxes throughout your game whenever you need one.
Vector3Box ( ) : stingray.Vector3BoxCreates a new zero-initialized Vector3Box.
|
This function does not accept any parameters. |
The newly created box. |
This will allocate new memory, so use this function sparingly. Typically, you should create as many boxes as you will need at any given time in an initialization function, and re-use the same boxes throughout your game whenever you need one.
Vector4 ( x, y, z, w ) : stingray.Vector4Creates and returns a new Vector4 object.
|
x : | number | The X component. |
y : | number | The Y component. |
z : | number | The Z component. |
w : | number | The W component. |
The newly constructed Vector4. |
Vector4Box ( x, y, z, w ) : stingray.Vector4BoxCreates a new Vector4Box, and stores the specified values in the box.
|
x : | number | The X component value to store in the box. |
y : | number | The Y component value to store in the box. |
z : | number | The Z component value to store in the box. |
w : | number | The W component value to store in the box. |
The newly created box. |
This will allocate new memory, so use this function sparingly. Typically, you should create as many boxes as you will need at any given time in an initialization function, and re-use the same boxes throughout your game whenever you need one.
Vector4Box ( vector ) : stingray.Vector4BoxCreates a new Vector4Box, and stores the specified vector in the box.
|
vector : | The vector to be stored in the box |
The newly created box. |
This will allocate new memory, so use this function sparingly. Typically, you should create as many boxes as you will need at any given time in an initialization function, and re-use the same boxes throughout your game whenever you need one.
Vector4Box ( ) : stingray.Vector4BoxCreates a new Vector4Box.
|
This function does not accept any parameters. |
The newly created box. |
This will allocate new memory, so use this function sparingly. Typically, you should create as many boxes as you will need at any given time in an initialization function, and re-use the same boxes throughout your game whenever you need one.
WebSocket ( host, port, request ) : stingray.WebSocketCreates a web socket connection to the specified URL.
|
host : | string | The IP of the web socket server to connect to. |
port : | number | The port of the web socket server to connect to. |
request : | string? | The URL request for the web socket server. Defaults to "". The ? notation indicates that this type is optional: there may be zero or one instances of it. |
The newly created WebSocket. |
WebSocket objects are garbage collected and do not need to be explicitly destroyed.