Stormworks: Build and Rescue

Stormworks: Build and Rescue

Not enough ratings
*LUA* drawArc function (for arcs and segments)
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
53.781 KB
13 Jun, 2019 @ 5:29am
13 Jun, 2019 @ 6:06am
3 Change Notes ( view )

Subscribe to download
*LUA* drawArc function (for arcs and segments)

Description
Showcase of a little function that allows you to draw a circle arc or circle segment.
The function can be minified to about 340 characters (or a bit less if you cut some of its features).

Usage is as follows:
drawArc(x, y, radius, *angle1, *angle2, *filled, *step)

The first 3 parameters are mandatory, the others can be left out.
The function will draw an arc or a filled circle segmet in a set radius between angle1 and angle2 around the center x,y.

Setting "filled" to true will cause it to draw a filled segment, otherwise just an arc.

"step" is used to define how round the circle is. This is set to 22.5° by default which is also what the drawCircle function uses in most cases. That means a full circle will consist of 8 segments.
4 Comments
MrCreeperman147 24 Apr, 2024 @ 4:28am 
Finally I found a smooth cirlce/arc function
Thank you for your hard work
PweeDos 1 Jul, 2022 @ 9:26pm 
Thanks! I've been searching for a good Arc function!:spiffo:
lexignatov 24 Dec, 2021 @ 12:34pm 
Great, can you show us code for usage in custom speedometers? I need compact function for drawing simple arc with start and end ange of it and center coordinates.
MonkeyKing73 18 Jun, 2019 @ 12:40am 
screen shots?