Skip to content

CleanNgon

Juju Adams edited this page Mar 22, 2021 · 13 revisions

 

CleanNgon(x, y, radius, sides)

Returns: N-gon struct

Name Datatype Purpose
x number x-coordinate of the n-gon's center
y number y-coordinate of the n-gon's center
radius number Radius of the n-gon, in pixels
sides integer Number of sides for the n-gon. Must be 3 or greater

N-gons are drawn as regular polygons.

N.B. A shape will only draw when you call the .Draw() method.

 

N-gon structs have the following methods:

 

.Draw()

Returns: N/A (undefined)

Name Datatype Purpose
None

 

.Blend(color, alpha)

Returns: self

Name Datatype Purpose
color 24-bit color Color of the shape
alpha number Alpha value of the shape

 

.Star(factor)

Returns: self

Name Datatype Purpose
factor number "Star factor", a number between 0.0 and 1.0 that describes the ratio of the outer radius of a star to its inner radius

 

.Rotate(angle)

Returns: self

Name Datatype Purpose
angle number Rotation angle of the shape, around its geometric centre, in degrees

 

.Border(thickness, color, alpha)

Returns: self

Name Datatype Purpose
thickness number Width of the border, in pixels
color 24-bit color Color of the border
alpha number Alpha of the border

 

.Rounding(radius)

Returns: self

Name Datatype Purpose
radius number Radius of the rounding on corners, in pixels. A value equal to or less than 0 removes all rounding