surface.DrawCircle

From Garry's Mod
Jump to: navigation, search
 surface.DrawCircle( )

Contents

Description

Draws a hollow circle, made of dots. For a filled circle, see examples for surface.DrawPoly.

NOTE

This is a rendering function that requires a 2D rendering context.
This means that it will only work in hooks with a 2D rendering context.

Arguments

number originX

The center x integer coordinate.

Arguments

number originY

The center y integer coordinate.

Arguments

number radius

The radius of the circle.

Arguments

number r

The red value of the color to draw the circle with, or a Color structure.

Arguments

number g

The green value of the color to draw the circle with. Unused if a Color structure was given.

Arguments

number b

The blue value of the color to draw the circle with. Unused if a Color structure was given.

Arguments

number a=255

The alpha value of the color to draw the circle with. Unused if a Color structure was given.

Examples

Example

Example usage. Draws an orange circle at position 500, 500 with a varying/animated radius of 50 to 150.

hook.Add( "HUDPaint", "DrawCircleExample", function()

	surface.DrawCircle( 500, 500, 100 + math.sin( CurTime() ) * 50, Color( 255, 120, 0 ) )

end )


Personal tools
Navigation