https://wiki.beyondunreal.com/w/index.php?action=history&feed=atomCpptext - Revision history2017-11-18T02:24:04ZRevision history for this page on the wikiMediaWiki 1.25.1https://wiki.beyondunreal.com/Cpptext?diff=43625&oldid=prevEliot at 02:44, 10 July 20102010-07-10T02:44:09Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 02:44, 10 July 2010</td>
</tr><tr><td colspan="2" class="diff-lineno" id="L1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Starting with [[Unreal Engine 2]] [[UnrealScript]] [[classes]]/[[struct|structs]] support '''cpptext'''(prefix for [[wp:C++]]<sup>text</sup>) block declarations. The '''cpptext''' is a block declaration where programmers can implement C++ functions it also can only be declared in native classes, any text within this block will then be exported to the corresponding native [[classes|class]] <code>''prefix''Classes.h</code> file when compiled.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Starting with [[Unreal Engine 2]] [[UnrealScript]] [[classes]]/[[struct|structs]] support '''cpptext'''(prefix for [[wp:<ins class="diffchange diffchange-inline">C++|</ins>C++]]<sup>text</sup>) block declarations. The '''cpptext''' is a block declaration where programmers can implement C++ functions it also can only be declared in native classes, any text within this block will then be exported to the corresponding native [[classes|class]] <code>''prefix''Classes.h</code> file when compiled.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>'''Note:''' structs use '''cppstruct''' instead and starting with [[Unreal Engine 3]] it was renamed to '''structcpptext'''.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>'''Note:''' structs use '''cppstruct''' instead and starting with [[Unreal Engine 3]] it was renamed to '''structcpptext'''.</div></td></tr>
</table>Eliothttps://wiki.beyondunreal.com/Cpptext?diff=43288&oldid=prevEliot at 20:54, 18 May 20102010-05-18T20:54:10Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 20:54, 18 May 2010</td>
</tr><tr><td colspan="2" class="diff-lineno" id="L1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Starting with [[Unreal Engine 2]] [[UnrealScript]] <del class="diffchange diffchange-inline">supports </del>'''cpptext'''(prefix for [[wp:C++]]<sup>text</sup>) block declarations. The '''cpptext''' is a block declaration where programmers can implement C++ functions it also can only be declared in native classes, any text within this block will then be exported to the corresponding native [[classes|class]] <code>''prefix''Classes.h</code> file when compiled.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Starting with [[Unreal Engine 2]] [[UnrealScript]] <ins class="diffchange diffchange-inline">[[classes]]/[[struct|structs]] support </ins>'''cpptext'''(prefix for [[wp:C++]]<sup>text</sup>) block declarations. The '''cpptext''' is a block declaration where programmers can implement C++ functions it also can only be declared in native classes, any text within this block will then be exported to the corresponding native [[classes|class]] <code>''prefix''Classes.h</code> file when compiled.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">Starting </del>with [[Unreal Engine 3]] <del class="diffchange diffchange-inline">[[struct|structs]] can also have a '''cpptext''' block but named as </del>'''structcpptext''' <del class="diffchange diffchange-inline">instead</del>.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">'''Note:''' structs use '''cppstruct''' instead and starting </ins>with [[Unreal Engine 3]] <ins class="diffchange diffchange-inline">it was renamed to </ins>'''structcpptext'''.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==Example==</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==Example==</div></td></tr>
</table>Eliothttps://wiki.beyondunreal.com/Cpptext?diff=43274&oldid=prevEliot: Created page with 'Starting with Unreal Engine 2 UnrealScript supports '''cpptext'''(prefix for wp:C++<sup>text</sup>) block declarations. The '''cpptext''' is a block declaration where…'2010-05-17T11:03:01Z<p>Created page with 'Starting with <a href="/edit/Unreal_Engine_2?redlink=1" class="new" title="Unreal Engine 2 (page does not exist)">Unreal Engine 2</a> <a href="/UnrealScript" title="UnrealScript">UnrealScript</a> supports '''cpptext'''(prefix for <a href="http://en.wikipedia.org/wiki/C%2B%2B" class="extiw" title="wp:C++">wp:C++</a><sup>text</sup>) block declarations. The '''cpptext''' is a block declaration where…'</p>
<p><b>New page</b></p><div>Starting with [[Unreal Engine 2]] [[UnrealScript]] supports '''cpptext'''(prefix for [[wp:C++]]<sup>text</sup>) block declarations. The '''cpptext''' is a block declaration where programmers can implement C++ functions it also can only be declared in native classes, any text within this block will then be exported to the corresponding native [[classes|class]] <code>''prefix''Classes.h</code> file when compiled.<br />
<br />
Starting with [[Unreal Engine 3]] [[struct|structs]] can also have a '''cpptext''' block but named as '''structcpptext''' instead.<br />
<br />
==Example==<br />
Taken from <code>Canvas.uc</code>.<br />
<uscript><br />
cpptext<br />
{<br />
//...<br />
void DrawTile(UTexture* Tex, FLOAT X, FLOAT Y, FLOAT XL, FLOAT YL, FLOAT U, FLOAT V, FLOAT UL, FLOAT VL, const FLinearColor& Color);<br />
//...<br />
}<br />
</uscript><br />
This exports <code>DrawTile</code> into class <code>UCanvas</code> in file <code>EngineClasses.h</code> e.g.<br />
<uscript><br />
class UCanvas : public UObject<br />
{<br />
//...<br />
void DrawTile(UTexture* Tex, FLOAT X, FLOAT Y, FLOAT XL, FLOAT YL, FLOAT U, FLOAT V, FLOAT UL, FLOAT VL, const FLinearColor& Color);<br />
//...<br />
};<br />
</uscript><br />
<br />
==Why use cpptext over native functions==<br />
Even though you can just make a native [[UnrealScript]] function that will also get exported the same way but then translated to C++, it doesn't support all formats thus in that case the native coder can implement functions that cannot be declared in UnrealScript but also because the native coder might not want you to be able to call a function from within UnrealScript.<br />
<br />
==See also==<br />
* [[Native Coding]]<br />
* [[Native-only classes]]<br />
<br />
{{navbox unrealscript}}</div>Eliot