Represents a viewport: a container for a view into the 3D world.
Constructors and accessors
Other related reference items
stingray.Application.create_viewport() stingray.Application.destroy_viewport() stingray.Application.render_world() stingray.Gui.resolution() | |
Core |
get_data ( self, indices ) : anyRetrieves the data set at the specified indices within the viewport's script data object.
|
self : | 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. |
any |
The value previously stored at the specified sequence of indices. |
Similar to Unit.get_data().
Other related reference items
has_data ( self, indices ) : booleanIndicates whether or not any data has been saved at the specified indices in the viewport's script data object.
|
self : | 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. |
boolean |
Returns true if a data value exists at the specified sequence of indices, or false otherwise. |
Similar to Unit.has_data().
set_data ( self, indices, indices, indices, value ) set_data ( self, indices, indices, value ) set_data ( self, indices, value )Stores the specified value in the viewport's script data object, at a location determined by the specified indices.
|
self : | 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. |
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().
set_rect ( self, x, y, width, height )Sets the position and dimension of the viewport.
|
self : | 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. |
This function does not return any values. |
The input range is in normalized coordinates.