| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
- <meta http-equiv="X-UA-Compatible" content="IE=9"/>
- <meta name="generator" content="Doxygen 1.8.3.1"/>
- <title>TorqueScript Reference: Construction Operators</title>
- <link href="tabs.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="jquery.js"></script>
- <script type="text/javascript" src="dynsections.js"></script>
- <link href="doxygen.css" rel="stylesheet" type="text/css" />
- <link href="t2d-stylesheet-extra.css" rel="stylesheet" type="text/css"/>
- </head>
- <body>
- <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
- <div id="titlearea">
- <table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
- <td style="padding-left: 0.5em;">
- <div id="projectname">TorqueScript Reference
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <!-- end header part -->
- <!-- Generated by Doxygen 1.8.3.1 -->
- <div id="navrow1" class="tabs">
- <ul class="tablist">
- <li><a href="index.html"><span>Main Page</span></a></li>
- <li><a href="pages.html"><span>Related Pages</span></a></li>
- <li><a href="modules.html"><span>Modules</span></a></li>
- <li><a href="annotated.html"><span>Classes</span></a></li>
- </ul>
- </div>
- </div><!-- top -->
- <div class="header">
- <div class="summary">
- <a href="#typedef-members">Typedefs</a> </div>
- <div class="headertitle">
- <div class="title">Construction Operators<div class="ingroups"><a class="el" href="group__Operators.html">Operators</a></div></div> </div>
- </div><!--header-->
- <div class="contents">
- <table class="memberdecls">
- <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
- Typedefs</h2></td></tr>
- <tr class="memitem:ga70a14b869c34d264188d162a1ffda28e"><td class="memItemLeft" align="right" valign="top">typedef type </td><td class="memItemRight" valign="bottom"><a class="el" href="group__constructionOperators.html#ga70a14b869c34d264188d162a1ffda28e">new</a></td></tr>
- <tr class="separator:ga70a14b869c34d264188d162a1ffda28e"><td class="memSeparator" colspan="2"> </td></tr>
- </table>
- <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
- <h2 class="groupheader">Typedef Documentation</h2>
- <a class="anchor" id="ga70a14b869c34d264188d162a1ffda28e"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">typedef type <a class="el" href="group__constructionOperators.html#ga70a14b869c34d264188d162a1ffda28e">new</a></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>create a new object</p>
- <dl class="section user"><dt>Format</dt><dd><div class="fragment"><div class="line">%myID = <span class="keyword">new</span> <span class="keyword">class</span>([name])</div>
- <div class="line">{</div>
- <div class="line"> [field = value;]</div>
- <div class="line"> ...</div>
- <div class="line">};</div>
- </div><!-- fragment --></dd></dl>
- <dl class="section user"><dt>Where</dt><dd><ul>
- <li><em>myID</em> is the return ID that can be used to access the object in the form <code>%myID.myFunction</code>.<br/>
- </li>
- <li><code>new</code> is the keyword telling the engine to create an instance of the following <em>class</em>.<br/>
- </li>
- <li><em>class</em> is any class declared in the engine or in script that has been derived from <a class="el" href="classSimObject.html">SimObject</a>.<br/>
- </li>
- <li><em>name</em> (optional) is the object's name for referencing in the form <code>name.myFunction</code> (without % or $ before it).<br/>
- </li>
- <li><em>field</em> - You may initialize static or dynamic class fields here, one at a time.<br/>
- </li>
- </ul>
- </dd></dl>
- <dl class="section user"><dt>Example</dt><dd><div class="fragment"><div class="line"><span class="comment">// An SceneObject named 'Truck'</span></div>
- <div class="line"><span class="comment">// with two static fields and one dynamic field to define</span></div>
- <div class="line"><span class="keyword">new</span> <a class="code" href="classSceneObject.html">SceneObject</a>(Truck) </div>
- <div class="line">{</div>
- <div class="line"> position = <span class="stringliteral">"0 0"</span>;</div>
- <div class="line"> size = <span class="stringliteral">"5 5"</span>;</div>
- <div class="line"> myField = 100;</div>
- <div class="line">};</div>
- <div class="line"></div>
- <div class="line"><span class="comment">// A nameless object (tracked by a variable), with no fields to set</span></div>
- <div class="line">%myObject = <span class="keyword">new</span> <a class="code" href="classSimSet.html">SimSet</a>();</div>
- </div><!-- fragment --> </dd></dl>
- </div>
- </div>
- </div><!-- contents -->
- <!-- start footer part -->
- <hr class="footer"/><address class="footer"><small>
- Generated by  <a href="http://www.doxygen.org/index.html">
- <img class="footer" src="doxygen.png" alt="doxygen"/>
- </a> 1.8.3.1
- </small></address>
- </body>
- </html>
|