Grabber
Description:
A grabber which is used to render a part of the scene to a texture by a grid of vertices.
Usage:
local node = Node()
node.size = Size(500, 500)
local grabber = node:grab(true)
grabber:moveUV(0, 0, Vec2(0, 0.1))
camera
Type: Field.
Description:
The camera used to render the texture.
Signature:
camera: Camera
effect
Type: Field.
Description:
The sprite effect applied to the texture.
Signature:
effect: SpriteEffect
blendFunc
Type: Field.
Description:
The blend function applied to the texture.
Signature:
blendFunc: BlendFunc
clearColor
Type: Field.
Description:
The clear color used to clear the texture.
Signature:
clearColor: Color
setPos
Type: Function.
Description:
Sets the position of a vertex in the grabber grid.
Signature:
setPos: function(self: Grabber, x: integer, y: integer, pos: Vec2, z?: number --[[0.0]])
Parameters:
Parameter | Type | Description |
---|---|---|
x | integer | The x-index of the vertex in the grabber grid. |
y | integer | The y-index of the vertex in the grabber grid. |
pos | Vec2 | The new position of the vertex. |
z | number | [optional] The new z-coordinate of the vertex (default: 0.0). |
getPos
Type: Function.
Description:
Gets the position of a vertex in the grabber grid.
Signature:
getPos: function(self: Grabber, x: integer, y: integer): Vec2
Parameters:
Parameter | Type | Description |
---|---|---|
x | integer | The x-index of the vertex in the grabber grid. |
y | integer | The y-index of the vertex in the grabber grid. |
Returns:
Return Type | Description |
---|---|
Vec2 | The position of the vertex. |
getColor
Type: Function.
Description:
Gets the color of a vertex in the grabber grid.
Signature:
getColor: function(self: Grabber, x: integer, y: integer): Color
Parameters:
Parameter | Type | Description |
---|---|---|
x | integer | The x-index of the vertex in the grabber grid. |
y | integer | The y-index of the vertex in the grabber grid. |
Returns:
Return Type | Description |
---|---|
Color | The color of the vertex. |
setColor
Type: Function.
Description:
Sets the color of a vertex in the grabber grid.
Signature:
setColor: function(self: Grabber, x: integer, y: integer, color: Color)
Parameters:
Parameter | Type | Description |
---|---|---|
x | integer | The x-index of the vertex in the grabber grid. |
y | integer | The y-index of the vertex in the grabber grid. |
color | Color | The new color of the vertex. |
moveUV
Type: Function.
Description:
Sets the UV coordinates of a vertex in the grabber grid.
Signature:
moveUV: function(self: Grabber, x: integer, y: integer, offset: Vec2)
Parameters:
Parameter | Type | Description |
---|---|---|
x | integer | The x-index of the vertex in the grabber grid. |
y | integer | The y-index of the vertex in the grabber grid. |
offset | Vec2 | The new UV coordinates of the vertex. |