Polygon(x, y, vertices, count[[, color], table])
vertices
parameter. The count
parameter specifies how many vertices your polygon
has. Additionally, you need to specify the color for the polygon (in RGB
format). The polygon will be drawn in the form style specified using
SetFormStyle() and will be filled according to the configuration selected
with SetFillStyle(). Also remember that the last vertex should close your
polygon, which means that it must be the same as the first vertex.
The vertices can also be negative and/or specified in floating point notation to achieve the best precision. Hollywood will not round them off before it does the final rasterization.
If layers are enabled, this command will add a new layer of the type
#POLYGON
to the layer stack.
New in Hollywood 2.0: Color can also be an ARGB value for alpha-blended drawing.
Starting with Hollywood 4.5, this function accepts a new optional table argument that can be used to specify one or more of the standard tags for all of Hollywood's draw commands. See Standard drawing tags for more information about the standard tags that nearly all Hollywood drawing commands support.
Note that when drawing to a palette-based target and the palette mode is set
to #PALETTEMODE_PEN
, this function will draw using the pen set via SetDrawPen()
instead of the color passed to the function.
#BLACK
)
color is optional because it is not required when you
render to a mask or alpha channelv = {} v[0] = 0 ;X1 v[1] = 100 ;Y1 v[2] = 50 ;X2 v[3] = 0 ;Y2 v[4] = 100 ;X3 v[5] = 100 ;Y3 v[6] = 0 ;X4 v[7] = 100 ;Y4 Polygon(#CENTER, #CENTER, v, 4, #RED)The above code draws a red triangle in the center of the display.
Polygon(#CENTER, #CENTER, v, 4, #RED, {Rotate = 45})The above code draws a triangle rotated by 45 degrees.