Garry's Mod Wiki



  function GWEN.CreateTextureCentered( number x, number y, number w, number h )


Used in derma skins to create a rectangle drawing function from an image. The rectangle will not be scaled, but instead it will be drawn in the center of the box. The texture is taken from SKIN.GwenTexture


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


1 function
The drawing function. Arguments are: number x - X coordinate for the box

number y - Y coordinate for the box

number w - Width of the box

number h - Height of the box

table clr - Optional color, default is white. Uses the Color


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

local paintBox = GWEN.CreateTextureCentered( 384, 32, 32, 32 ) hook.Add( "HUDPaint", "PaintStuff", function() paintBox( 0, 0, 100, 100 ) end )
Output: If using default skin, it will be 32x32 transparent blue box centered inside the 100x100 box.

Special Pages



Render Time: 53ms

DB GetPage 23
Generate Html 10
SaveChanges (1) 9
Render Body 0
Render Sidebar 8