Revision Difference
render.DrawWireframeBox#568554
<function name="DrawWireframeBox" parent="render" type="libraryfunc">
<description>
Draws a wireframe box in 3D space.
Draws a wireframe box (outlines) in 3D space.
⤶
For a function that draws a filled box, see <page>render.DrawBox</page>.⤶
<rendercontext hook="false" type="3D"></rendercontext>
</description>
<realm>Client</realm>
<args>
<arg name="position" type="Vector">Position of the box.</arg>
<arg name="angle" type="Angle">Angles of the box.</arg>
<arg name="mins" type="Vector">The lowest corner of the box.</arg>
<arg name="maxs" type="Vector">The highest corner of the box.</arg>
<arg name="color" type="Color" default="Color( 255, 255, 255 )">The color of the box.</arg>
<arg name="writeZ" type="boolean" default="false">Sets whenever to write to the zBuffer.</arg>
</args>
</function>
⤶
⤶
⤶
<example>⤶
<description>Draws a white outlined box at the position you are looking at. Uses the normal DrawBox function for the fill color, and wireframe box function to give the filled box some contrast and shape.</description>⤶
<code>⤶
local boxSize = Vector( 10, 10, 10 )⤶
local boxColor = Color( 255, 255, 255, 100 )⤶
local outlineColor = Color( 255, 255, 255, 255 )⤶
⤶
hook.Add( "PostDrawTranslucentRenderables", "BoxxieWithOutline", function()⤶
local pos = LocalPlayer():GetEyeTrace().HitPos -- position to render box at⤶
⤶
render.DrawWireframeBox( pos, angle_zero, -boxSize, boxSize, outlineColor, true )⤶
⤶
render.SetColorMaterial() -- material for coloring⤶
render.DrawBox( pos, angle_zero, -boxSize, boxSize, boxColor )⤶
end )⤶
</code>⤶
<output>⤶
What the example does:⤶
<upload src="70c/8df3e764af8dae7.png" size="235737" name="image.png" />⤶
⤶
For reference, the wireframe box alone:⤶
<upload src="70c/8df3e770883578f.png" size="391920" name="image.png" />⤶
</output>⤶
</example>
Garry's Mod
Rust
Steamworks
Wiki Help