util.GetPixelVisibleHandle

From GMod Wiki

Jump to: navigation, search
Function
Syntax util.GetPixelVisibleHandle( )
Where is this used?
Description:
Returns the pixel visible handle to use with util.PixelVisible.
Returns: pixelvis_handle_t
Part of Library: Util
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Util.GetPixelVisibleHandle]Util.GetPixelVisibleHandle [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionDraws a box when the center of the map is visible on your screen.
Used onNewerClient.png
Code
local PixVis = nil
function SetupPixVis()
	PixVis = util.GetPixelVisibleHandle()
end
hook.Add("Initialize", "SetupPixVis", SetupPixVis)
 
function TestPixelVisibility()
	local visible = util.PixelVisible(Vector(0, 0, 0), 16, PixVis)
 
	if visible && visible != 0 then
		draw.RoundedBox( 10, 0, 0, 100, 100, Color(0, 0, 0, 200 * visible) )
	end
end
hook.Add("HUDPaint", "TestPixelVisibility", TestPixelVisibility)
OutputDraws a box when the center of the map is visible on your screen.


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox