stingray namespace reference - Stingray Lua API Reference

stingray namespace reference

Description

The main namespace for the Lua API elements provided by the Stingray3D engine.

Namespaces

The interface for accessing the achievement functionality on Steam.
Use this API to check and request permission to access system resources and data on Android platforms.
Interface to access global application functionality.
Use the functions in the BlendShape API to set and retrieve blending weights for specific units.
The interface to the load and save functionality on the Windows platform.
Interface to output to the command window.
[WebServer] Namespace with functions for interacting with the console server.
The interface for accessing the NetCtl connection status on PlayStation 4.
You can use the functions in the DisplayAdapter interface to access the GPUs and outputs (screens) that are connected to the system.
The interface to access information about downloaded content (DLC).
Manager for creating and destroying entities.
The interface to access the error dialog system on the PlayStation 4.
Interface to access firing events on xbox one.
This interface handles friends on Steam.
This object provides access to the GearVR interface.
This object provides access to the Google VR interface.
Functions used for debugging and only defined in development builds.
Provides access to the various operations we can perform on the NavMesh (e.g. raycast).
Functions allowing to traverse NavMesh triangles
This object provides access to the Hololens interface.
Implements a simple HTTP client.
This object provides access to the HumanIK interface.
This table contains functions, enums and more to help you parse input-events sent from the user as an alternative to the state-based functions available in the InputControllers.
A global singleton that represents the keyboard.
This interface is for accessing the leaderboards functionality on Steam.
Contains functions that operate on level resources set up in the level editor.
The Math object contains some helpful generic math functions.
The interface to access the mod system.
A global singleton that represents the mouse.
The interface to access the message dialog system on the PlayStation 4.
The interface to access session functionality on Xbox One.
The interface to access session group functionality on Xbox One.
The Network object is the main interface to the system used for playing multiplayer games over the network.
The interface to access the check plus and check availability functionality on PlayStation 4.
The NpCommerceDialog can currently only be used for the PlayStation Plus dialog.
This object provides access to the Oculus interface.
Interface for monitoring streaming installs on Xbox One.
A global singleton that represents the first connected game pad.
A global singleton that represents the second connected game pad.
A global singleton that represents the third connected game pad.
A global singleton that represents the fourth connected game pad.
Interface to access PlayGo on PS4.
Interface to interact with the Stingray plugin system.
This interface handles presence on Steam.
The interface to the built-in profiling system.
These functions are specific to PlayStation 4.
This interface handles the PS4 on-screen keyboard (ImeDialog).
A global singleton that represents the first connected PS4 game pad on Windows.
A global singleton that represents the second connected PS4 game pad on Windows.
A global singleton that represents the third connected PS4 game pad on Windows.
A global singleton that represents the fourth connected PS4 game pad on Windows.
The interface to access QoSVoiceChat functionality on PlayStation 4.
Interface to create/destroy render resources.
The RPC object is used to make remote calls to other connected peers in a networked game.
The interface to access the save and load functionality.
The interface to access save system dialog functionality on PlayStation 4.
The interface to access score functionality on PlayStation 4.
The Script interface contains helper functions for manipulating scripts.
Interface to communicate with devices sensors.
Represents a mouse-simulated touch panel, available only on Windows platforms.
The interface to access Social Manager functionality on Xbox One.
The interface for accessing the player statistics functionality on Steam.
The interface to access core Steam functionality on the Windows platform.
This is the starting point for voice communication using Steam.
This represents a room where people can talk to each other in over the Internet.
This object provides access to the SteamVR interface.
Used to communicated with the Synergy mouse and keyboard sharing service.
A global singleton that represents a keyboard connected to a Synergy server.
A global singleton that represents a mouse connected to a Synergy server.
A global singleton that represents a pressure-sensitive tablet interface.
A system for procedurally generating terrain decoration such as grass and other types of debris.
A global singleton that represents the first connected touchpad controller.
A global singleton that represents the second connected touchpad controller.
The interface to access trophy functionality on PlayStation 4.
The interface to access the title user storage (TUS) functionality on PlayStation 4.
Contains functions that operate on unit resources.
All strings that the engine uses are UTF-8 encoded.
The interface to access voice chat functionality on Xbox One.
The Wwise object is a singleton that provides Stingray game code with an interface to the Wwise engine APIs.
Used to implement callbacks.
Used to communicated with the ConnectedStorage (save data) system on Xbox One.
Interface for managing XboxOne downloadable content.
The interface to access users and other miscellaneous functionality Xbox Live on Xbox One.

Objects

Interface to access achievements on xbox one.
Interface to a physics actor.
A "box" that stores an Actor object across multiple frames, ensuring that the stored Actor has not become invalid by being destroyed in the physics world.
A component that can store arbitrary values accessed by keys.
A component that handles animation blending for an entity.
An interface for sampling custom animation curves.
A component that handles animation state machines for an entity.
An opaque object that represents a three-dimensional oriented bounding box.
A data structure that you can use to quickly search for units in a game level.
Represents a game camera.
Represents an Apex Cloth actor.
An opaque object returned by several asynchronous functions in the stingray.Cloud interface.
A component that can store arbitrary values accessed by keys.
A component that stores a debug name for the entity.
Opaque object representing an entity.
A data structure that represents an array of float.
A component that adds flow to an entity.
The GameSession object is responsible for replicating and synchronizing game objects between the peers that participate in a networked game session.
A Gui is an object that manages primitive 2D shapes -- like rectangles, triangles, and text -- and draws them in the engine viewport.
Provides access to the main PathFinding Query of Navigation.
Represents a Navigation bot.
Represents a dynamic box obstacle.
Represents a dynamic cylinder obstacle.
Represents a Navigation NavData.
Represents a Navigation database.
Functions used for generating NavData.
Represents a graph of points.
Provides access to some output from GwNavQueries.
Represents the Entrance and Exit points for a [GwNavSmartObject].
Allows to customize GwNavTraverseLogicData.
Represents a volume that tags the NavMesh dynamically.
Allows to customize queries and pathfinding.
Represents a NavMesh Triangle.
Represents a Navigation world.
A hashed string value.
A "box" that stores a IdString32Box object across multiple frames.
A hashed string value.
A "box" that stores a IdString64Box object across multiple frames.
Interface to a physics joint.
Represents a network node in a LAN game.
Represents a lobby in a LAN game.
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.
Represents a level that has been loaded into the runtime game world.
Describes a game light.
Used to draw debug lines in the game world.
The Localizer is a helper interface that offers access to localized strings that are contained in a single specified .strings resource.
This interface provides a Level of Detail selector: a wrapper over a number of mesh objects that selects which mesh should be rendered depending on the screen space projection of the LOD object's bounding sphere.
Represents a material.
Represents a 4x4 matrix that stores both the position and the orientation of an object.
A "box" that stores a Matrix4x4 object across multiple frames.
Describes a mesh.
A component that can store arbitrary values accessed by keys.
Provides an interface to a physics mover / character controller.
Matches the Microsoft.Xbox.Services.Multiplayer.MultiplayerSessionRestriction enum in the XDK documentation.
Matches the Microsoft.Xbox.Services.Multiplayer.MultiplayerSessionVisibility enum in the XDK documentation.
A navigation mesh in a level.
Matches the Microsoft.Xbox.Services.Experimental.Social.Manager.PeoplehubDetailLevel enum in the XDK documentation.
Represents a physics world: a collection of interacting physics objects where Actors live.
Matches the Microsoft.Xbox.Services.Matchmaking.PreserveSessionMode enum in the XDK documentation.
API for manipulating procedurally generated meshes.
Represents a network node in a PlayStation Network (PSN) game.
Represents a room in a PlayStation Network (PSN) game.
The PsnRoomBrowser provides access to the list of game rooms available on the PlayStation Network (PSN).
Represents a rotation in the quaternion formulation (x, y, z, w).
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.
API for manipulating buffers of data for rendering.
A component that can store arbitrary values accessed by keys.
Opaque object representing a RenderResource
The Replay object can be used to replay events that have occurred in the game world.
An interface for loading and unloading packages (groups of resources that you define in data files with the .package extension).
An opaque object returned by several asynchronous functions in the stingray.SaveSystem interface.
Used to spawn large number of units.
A component that assigns a scene graph (node hierarchy) to an entity.
A component that adds scripting support to entities.
These constants may be returned by calls to stingray.Network.clean_sessions_status().
NOTE: This object and its API are considered deprecated in favor of the workflow based on entities.
Status of the SmartMatch matchmaking.
Matches the Microsoft.Xbox.Services.Experimental.Social.Manager.SocialEventType enum in the XDK documentation.
Matches the Microsoft.Xbox.Services.Experimental.Social.Manager.PresenceFilter enum in the XDK documentation.
Matches the Microsoft.Xbox.Services.Experimental.Social.Manager.RelationshipFilter enum in the XDK documentation.
Represents a client network node in a Steam game.
Represents a server node in a Steam game.
Represents a lobby for a game server.
Represents a lobby in a Steam game.
The SteamLobbyBrowser provides access to the list of game lobbies available on the Steam.
Used to measure the ping time, which reports how fast messages can be bounced between the two network cards.
The SteamServerBrowser provides access to the list of game servers available on Steam.
This represents a client that can communicate with others in a room.
A class that can play stories, or cutscenes.
A component that handles tags for an entity.
Represents a terrain.
Matches the Windows.Xbox.Management.Deployment.PackageTransferStatus enum in the XDK documentation.
A component that lets entities be positioned in the world.
Each Unit object represents a single game unit, such as a character, a building, or another object in a game level.
A component that links a unit to an entity.
The UnitSynchronizer is a helper object that synchronizes the creation, destruction, position and rotation of units across multiple networked peers.
Describes a three-dimensional vector.
A "box" that stores a Vector2 object across multiple frames.
Describes a three-dimensional vector.
A "box" that stores a Vector3 object across multiple frames.
Describes a three-dimensional vector.
A "box" that stores a Vector4 object across multiple frames.
Represents a vector field.
Interface to a physics vehicle.
An object that can play video.
Represents a viewport: a container for a view into the 3D world.
Matches the Windows.Xbox.Chat.ChatParticipantTypes enum in the XDK documentation.
Matches the Windows.Xbox.Chat.ChatRestriction enum in the XDK documentation.
Matches the Microsoft.Xbox.GameChat.ChatUserTalkingMode enum in the XDK documentation.
Implements a web socket client interface.
Represents an application window on Win32 and MacOS X.
Represents a game world.
This object provides access to functions for controlling sound events for a particular game World.
This object is a container for constants that reflect the state of the Xbox One device.

Enumerations

Bone transform mode for AnimationBlender.
Root transform mode for AnimationBlender.
Constant used by the [event_queue] function to differentiate button ids.
Direction constant returned by the gesture_swipe() function in touch controllers like the TouchPanel1 and TouchPanel2.

Functions

Parameters

user :

number

The user to enumerate Achievements for.

Returns

Achievements

The newly created Achievements object.

Parameters

actor :

stingray.Actor

A physics actor to store in the newly created box.

Returns

ActorBox

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.

Parameters
This function does not accept any parameters.
Returns

ActorBox

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.

Parameters

resource :

string

The animation curves resource to load.

Returns

AnimationCurves

The newly created animation curve set.

Parameters

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.

Returns

Broadphase

The newly created broadphase data structure.

Broadphase objects are garbage collected and do not need to be explicitly destroyed.

Parameters

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

color

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)
Parameters
This function does not accept any parameters.
Returns

Float32Array

The newly created Float32Array data structure.

Parameters

s :

string

The string to hash.

Returns

IdString32

A hashed representation of the string s.

Parameters

s :

string

The string to hash.

Returns

IdString32

A hashed representation of the string s.

Parameters

s :

string

The string to hash.

Returns

IdString64

A hashed representation of the string s.

Parameters

s :

string

The string to hash.

Returns

IdString64

A hashed representation of the string s.

Parameters

strings :

string

The .strings file.

Returns

Localizer

The newly created localizer.

Parameters

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.

Returns

Matrix4x4

The newly created matrix.

Equivalent to Matrix4x4.from_elements().

Parameters
This function does not accept any parameters.
Returns

Matrix4x4Box

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.

Parameters

axis :

stingray.Vector3

The main axis for the quaternion.

angle :

number

The angle around the main axis, expressed in radians.

Returns

Quaternion

The newly created quaternion.

Equivalent to stingray.Quaternion.axis_angle().

Parameters

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.

Returns

QuaternionBox

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.

Parameters

quat :

stingray.Quaternion

The quaternion to be stored in the box

Returns

QuaternionBox

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.

Parameters
This function does not accept any parameters.
Returns

QuaternionBox

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.

Parameters

name :

string?

Optional. Specifies the name.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns

RefTracker

Creates a new RefTracker instance.

Parameters

pos :

stingray.Vector2

Specifies the position of an object.

angle :

number

The angle in which the object must be rotated (clockwise in radians).

pivot :

stingray.Vector2?

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.
Returns

rotation2D

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))

Parameters

connect :

any(stingray.SteamClient, stingray.SteamGameServer)

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.
Returns

SteamPingThread

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.

Parameters

x :

number

The extent of the vector along the X axis.

y :

number

The extent of the vector along the Y axis.

Returns

Vector2

The newly constructed Vector2.

Parameters

vector :

stingray.Vector2

The vector to be stored in the box

Returns

Vector2Box

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.

Parameters

x :

number

The X component value to store in the box.

y :

number

The Y component value to store in the box.

Returns

Vector2Box

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.

Parameters
This function does not accept any parameters.
Returns

Vector2Box

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.

Parameters

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.

Returns

Vector3

The newly constructed Vector3.

Parameters

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.

Returns

Vector3Box

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.

Parameters

vector :

stingray.Vector3

The vector to be stored in the box

Returns

Vector3Box

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.

Parameters
This function does not accept any parameters.
Returns

Vector3Box

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.

Parameters

x :

number

The X component.

y :

number

The Y component.

z :

number

The Z component.

w :

number

The W component.

Returns

Vector4

The newly constructed Vector4.

Parameters

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.

Returns

Vector4Box

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.

Parameters

vector :

stingray.Vector4

The vector to be stored in the box

Returns

Vector4Box

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.

Parameters
This function does not accept any parameters.
Returns

Vector4Box

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.

Parameters

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.
Returns

WebSocket

The newly created WebSocket.

WebSocket objects are garbage collected and do not need to be explicitly destroyed.