graphics.drawRectangle: Difference between revisions

From GTA Connected
Jump to navigation Jump to search
No edit summary
No edit summary
 
(2 intermediate revisions by one other user not shown)
Line 6: Line 6:
|parameters = Surface surface, Vec2 position, Vec2 size, [ int colour1 = COLOUR_WHITE ], [ int colour2 = COLOUR_WHITE ], [ int colour3 = COLOUR_WHITE ], [ int colour4 = COLOUR_WHITE ], [ float rotation = 0.0 ], [ Vec2 center = Vec2(0.0,0.0) ], [ Vec2 sourcePos = Vec2(0.0,0.0) ], [ Vec2 sourceSize = Vec2(1.0,1.0) ], [ Vec2 scale = Vec2(1.0,1.0) ]
|parameters = Surface surface, Vec2 position, Vec2 size, [ int colour1 = COLOUR_WHITE ], [ int colour2 = COLOUR_WHITE ], [ int colour3 = COLOUR_WHITE ], [ int colour4 = COLOUR_WHITE ], [ float rotation = 0.0 ], [ Vec2 center = Vec2(0.0,0.0) ], [ Vec2 sourcePos = Vec2(0.0,0.0) ], [ Vec2 sourceSize = Vec2(1.0,1.0) ], [ Vec2 scale = Vec2(1.0,1.0) ]
|parameter1 = Surface surface The surface object, which can be null.
|parameter1 = Surface surface The surface object, which can be null.
|parameter2 = Vec3 position The 2D position for the rectangle.
|parameter2 = Vec3 position The 2D position for the rectangle, in pixels.
|parameter3 = Vec3 size The 2D size for the rectangle.
|parameter3 = Vec3 size The 2D size for the rectangle, in pixels.
|parameter4 = int colour1 optional COLOUR_WHITE The 1st colour for the rectangle.
|parameter4 = int colour1 optional COLOUR_WHITE The 1st colour for the rectangle, created by [[toColour|toColour]].
|parameter5 = int colour2 optional COLOUR_WHITE The 2nd colour for the rectangle.
|parameter5 = int colour2 optional COLOUR_WHITE The 2nd colour for the rectangle, created by [[toColour|toColour]].
|parameter6 = int colour3 optional COLOUR_WHITE The 3rd colour for the rectangle.
|parameter6 = int colour3 optional COLOUR_WHITE The 3rd colour for the rectangle, created by [[toColour|toColour]].
|parameter7 = int colour4 optional COLOUR_WHITE The 4th colour for the rectangle.
|parameter7 = int colour4 optional COLOUR_WHITE The 4th colour for the rectangle, created by [[toColour|toColour]].
|parameter8 = float rotation optional 0.0 The rotation of the rectangle.
|parameter8 = float rotation optional 0.0 The rotation of the rectangle.
|parameter9 = Vec2 center optional Vec2(0.0,0.0) The center of the rectangle.
|parameter9 = Vec2 center optional Vec2(0.0,0.0) The center of the rectangle.

Latest revision as of 23:08, 16 September 2022

Function Client Only icon-iii.png icon-vc.png icon-sa.png icon-iv.png Online and Offline

Available since Client 1.0.0

void graphics.drawRectangle(Surface surface, Vec2 position, Vec2 size, [ int colour1 = COLOUR_WHITE ], [ int colour2 = COLOUR_WHITE ], [ int colour3 = COLOUR_WHITE ], [ int colour4 = COLOUR_WHITE ], [ float rotation = 0.0 ], [ Vec2 center = Vec2(0.0,0.0) ], [ Vec2 sourcePos = Vec2(0.0,0.0) ], [ Vec2 sourceSize = Vec2(1.0,1.0) ], [ Vec2 scale = Vec2(1.0,1.0) ])

The graphics.drawRectangle function is used to draw a rectangle in 2D space.

Parameters

1) Surface surface The surface object, which can be null.
2) Vec3 position The 2D position for the rectangle, in pixels.
3) Vec3 size The 2D size for the rectangle, in pixels.
4) int colour1 Optional, defaults to COLOUR_WHITE. The 1st colour for the rectangle, created by toColour.
5) int colour2 Optional, defaults to COLOUR_WHITE. The 2nd colour for the rectangle, created by toColour.
6) int colour3 Optional, defaults to COLOUR_WHITE. The 3rd colour for the rectangle, created by toColour.
7) int colour4 Optional, defaults to COLOUR_WHITE. The 4th colour for the rectangle, created by toColour.
8) float rotation Optional, defaults to 0.0. The rotation of the rectangle.
9) Vec2 center Optional, defaults to Vec2(0.0,0.0). The center of the rectangle.
10) Vec2 sourcePos Optional, defaults to Vec2(0.0,0.0). The source position of the rectangle.
11) Vec2 sourceSize Optional, defaults to Vec2(1.0,1.0). The source size of the rectangle.
12) Vec2 scale Optional, defaults to Vec2(1.0,1.0). The scale of the rectangle.

Return

void This function doesn't return a value.

Notes

There aren't any notes for this function.

Examples

There aren't any examples for this function.

Compatibility

There isn't any compatibility information for this function.