Garry's Mod Wiki

Garry's Mod Wiki

  function GWEN.CreateTextureBorder( number x, number y, number w, number h, number left, number top, number right, number bottom, IMaterial material = nil )


Used in derma skins to create a bordered rectangle drawing function from an image.

The texture is taken from SKIN.GwenTexture when the material argument is not supplied.


1 number x
The X coordinate on the texture.
2 number y
The Y coordinate on the texture.
3 number w
Width of the area on texture.
4 number h
Height of the area on texture.
5 number left
Left width of border.
6 number top
Top width of border.
7 number right
Right width of border.
8 number bottom
Bottom width of border.
9 IMaterial material = nil
If set, given material will be used over the SKIN's default material, which is SKIN.GwenTexture.


1 function drawFunc
The drawing function.
Function argument(s):
1 number x - X coordinate for the box.
2 number y - Y coordinate for the box.
3 number w - Width of the box.
4 number h - Height of the box.
5 table clr - Optional color, default is white. Uses the Color.


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.

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...