util.Decal

From GMod Wiki

Jump to: navigation, search
Function
Syntax util.Decal( String Decal Name, Vector Position 1, Vector Position 2 )
Where is this used?
Description:
Paints a decal.
Returns: nil
Part of Library: Util
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Util.Decal]Util.Decal [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionPaint a scorch decal on the world right below the center of the world.
Used onNewerShared.png
Code
local traceworld = {}
traceworld.start = Vector(0,0,0) // The center of Source's world, is unlikely to be the actual center of the map however.
traceworld.endpos = traceworld.start + (Vector(0,0,-1) * 8000) // Aim downwards and up to 8000 units away from the Start.
local trw = util.TraceLine(traceworld) // Send the trace and get the results.
local worldpos1 = trw.HitPos + trw.HitNormal // Set worldpos 1. Add to the hitpos the world normal.
local worldpos2 = trw.HitPos - trw.HitNormal // Set worldpos 2. Subtract from the hitpos the world normal.
 
util.Decal("Scorch",worldpos1,worldpos2)
OutputN/A


DescriptionThis function will paint a small scorch where the player is looking.
Used onNewerShared.png
Code
function SWEP:PaintScorch()
	local tr = self.Owner:GetEyeTrace()
		local Pos1 = tr.HitPos + tr.HitNormal
		local Pos2 = tr.HitPos - tr.HitNormal
	util.Decal("SmallScorch", Pos1, Pos2)
end
OutputN/A


Additional Notes

"Antlion.Splat"
"BeerSplash"
"BirdPoop"
"Blood"
"BulletProof"
"Cross"
"Dark"
"ExplosiveGunshot"
"Eye"
"FadingScorch"
"GlassBreak"
"Impact.Antlion"
"Impact.BloodyFlesh"
"Impact.Concrete"
"Impact.Glass"
"Impact.Metal"
"Impact.Sand"
"Impact.Wood"
"Light"
"ManhackCut"
"Nought"
"Noughtsncrosses"
"PaintSplatBlue"
"PaintSplatGreen"
"PaintSplatPink"
"Scorch"
"SmallScorch"
"Smile"
"Splash.Large"
"YellowBlood"
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox