Viewport - stingray.Viewport object reference - Stingray Lua API Reference

stingray.Viewport object reference

Description

Represents a viewport: a container for a view into the 3D world.

Functions

Parameters

self :

stingray.Viewport

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

indices :

any(integer, string)+

One or more indices for the data, which may be integers or strings.

The + notation indicates that there may be one or more instances of the specified type.
The any(...) notation indicates that this item may be an instance of any of the types shown in the parentheses.
Returns

any

The value previously stored at the specified sequence of indices.

Similar to Unit.get_data().

Parameters

self :

stingray.Viewport

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

indices :

any(integer, string)+

One or more indices for the data, which may be integers or strings.

The + notation indicates that there may be one or more instances of the specified type.
The any(...) notation indicates that this item may be an instance of any of the types shown in the parentheses.
Returns

boolean

Returns true if a data value exists at the specified sequence of indices, or false otherwise.

Similar to Unit.has_data().

Parameters

self :

stingray.Viewport

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

indices :

any(integer, string)

One or more indices for the data, which may be integers or strings.

The any(...) notation indicates that this item may be an instance of any of the types shown in the parentheses.

value :

any

The value to store.

Returns
This function does not return any values.

You can retrieve the data later by passing the same indices in a call to get_data(). Similar to Unit.set_data().

Parameters

self :

stingray.Viewport

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

x :

number

The X coordinate of the upper left corner of the viewport.

y :

number

The Y coordinate of the upper left corner of the viewport.

width :

number

The width of the rectangle.

height :

number

The height of the rectangle.

Returns
This function does not return any values.

The input range is in normalized coordinates.