Garry's Mod Wiki

Revision Difference

Global.Angle#518374

<function name="Angle" parent="Global" type="libraryfunc"> <description>Creates an <page>Angle</page> object.</description> <realm>Shared and Menu</realm> <args> <arg name="pitch" type="number" default="0">The pitch value of the angle.&#xA;&#xA;&#xA;If this is an &lt;page&gt;Angle&lt;/page&gt;, this function will return a copy of the given angle.&#xA;&#xA;&#xA;If this is a &lt;page&gt;string&lt;/page&gt;, this function will try to parse the string as a angle. If it fails, it returns a 0 angle.&#xA;(See examples)</arg> <arg name="pitch" type="number" default="0">The pitch value of the angle. If this is an <page>Angle</page>, this function will return a copy of the given angle. If this is a <page>string</page>, this function will try to parse the string as a angle. If it fails, it returns a 0 angle. (See examples)</arg> <arg name="yaw" type="number" default="0">The yaw value of the angle.</arg> <arg name="roll" type="number" default="0">The roll value of the angle.</arg> </args> <rets> <ret name="" type="Angle">Created angle</ret> </rets> </function> <example> <description>Creates an angle and prints the value to the console.</description> <code> print( Angle( 1, 2, 3 ) ) print( Angle( "4 5 6" ) ) local test = Angle( 7, 8, 9 ) print( Angle( test ) ) print( Angle( "4 5 test" ) ) print( Angle() ) </code> <output> ``` 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 0.00 0.00 0.00 0.00 0.00 0.00 ``` </output> </example>