Garry's Mod Wiki

surface.DrawOutlinedRect

surface.DrawOutlinedRect( number x, number y, number w, number h, number thickness )

Description

Draws a hollow box with a given border width.

This is a rendering function that requires a 2d rendering context.

This means that it will only work in 2d Rendering Hooks.

Arguments

1 number x
The start x integer coordinate.
2 number y
The start y integer coordinate.
3 number w
The integer width.
4 number h
The integer height.
5 number thickness
The thickness of the outlined box border.

Example

Draws a 100x100 outlined rectangle in top left corner.

hook.Add( "HUDPaint", "DrawOutlinedRect", function() surface.SetDrawColor( 255, 255, 255, 128 ) surface.DrawOutlinedRect( 25, 25, 100, 100, math.floor( math.sin( CurTime() * 5 ) * 5 ) + 10 ) end )

Page Links


Special Pages


Wikis

?

Render Time: 69ms

DB GetPage 28
Generate Html 20
SaveChanges (1) 11
Render Body 0
Render Sidebar 7