surface.DrawTexturedRectRotated

From GMod Wiki

Jump to: navigation, search
Function
Syntax surface.DrawTexturedRectRotated( Number x, Number y, Number width, Number height, Number rotation )
Where is this used?
Description:
Draws a textured rectangle that is rotated, assuming that the required values have been set. The texture is set by Surface.SetTexture.
Returns: nil
Part of Library: surface
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Surface.DrawTexturedRectRotated]Surface.DrawTexturedRectRotated [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionDraw a rotated textured rectangle.
Used onNewerClient.png
Code
local texture = surface.GetTextureID("mytexture/mytexture"); -- No file types.
function DrawBox()
   surface.SetTexture(texture)
   surface.SetDrawColor(255,255,255,255) -- So it draws in normal color.
   surface.DrawTexturedRectRotated(x,y,width,height,90) -- Note: Rotation is ANTI-CLOCKWISE.
end
hook.Add("HUDPaint", "MyTexture", DrawBox)
 
OutputTextured Rectangle!.


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox