GWEN.CreateTextureBorder

From Garry's Mod
Jump to: navigation, search
 GWEN.CreateTextureBorder( )

Contents

Description

Used in derma skins to create a bordered rectangle drawing function from an image. The texture is taken either from last argument or from SKIN.GwenTexture

Arguments

number x

The X coordinate on the texture

Arguments

number y

The Y coordinate on the texture

Arguments

number w

Width of the area on texture

Arguments

number h

Height of the area on texture

Arguments

number left

Left width of border

Arguments

number top

Top width of border

Arguments

number right

Right width of border

Arguments

number bottom

Bottom width of border

Arguments

IMaterial source=nil

Texture of source image to create a bordered rectangle from. Uses SKIN.GwenTexture if not set.

Returns

function

The drawing function. Arguments are:

Examples

Example

Draws a bordered box in the top left corner of the screen using current skins texture.

local paintBox = GWEN.CreateTextureBorder( 384, 32, 31, 31, 4, 4, 4, 4 )
hook.Add( "HUDPaint", "PaintStuff", function()
    paintBox( 0, 0, 100, 100 )
end )

Output:

If using default skin, it will be a 100x100px transparent blue box in top left corner with solid blue borders.
Personal tools
Navigation