godot-cpp-utils-docs/html/godot__macros_8hpp.html

464 lines
25 KiB
HTML
Raw Normal View History

2024-05-29 21:15:31 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.7"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>godot-cpp-utils: godot_macros.hpp File Reference</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>
2024-05-29 22:09:05 +00:00
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
2024-05-29 21:15:31 +00:00
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
2024-05-29 21:29:38 +00:00
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function() { init_search(); });
/* @license-end */
</script>
2024-05-29 21:15:31 +00:00
<link href="doxygen.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 id="projectrow">
<td id="projectalign">
<div id="projectname">godot-cpp-utils
</div>
<div id="projectbrief">A collection of utility classes, functions and macros for use with Godot and GDExtension.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.7 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
2024-05-29 21:29:38 +00:00
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<span id="MSearchSelect" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
<input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
2024-05-29 22:09:05 +00:00
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('godot__macros_8hpp.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
2024-05-29 21:15:31 +00:00
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#define-members">Macros</a> </div>
<div class="headertitle"><div class="title">godot_macros.hpp File Reference</div></div>
</div><!--header-->
<div class="contents">
<p>C-style preprocessor macros to simplify using godot's C++ API.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;godot_cpp/classes/engine.hpp&quot;</code><br />
<code>#include &quot;godot_cpp/core/class_db.hpp&quot;</code><br />
<code>#include &quot;godot_cpp/variant/string.hpp&quot;</code><br />
</div>
<p><a href="godot__macros_8hpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a7458deef1a40348503d0a48ffd0003f6"><td class="memItemLeft" align="right" valign="top"><a id="a7458deef1a40348503d0a48ffd0003f6" name="a7458deef1a40348503d0a48ffd0003f6"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>MACRO_STRING_INNER</b>(_Arg)&#160;&#160;&#160;#_Arg</td></tr>
<tr class="separator:a7458deef1a40348503d0a48ffd0003f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0be8cf11055d2f4c194baa2c5cbb8b19"><td class="memItemLeft" align="right" valign="top"><a id="a0be8cf11055d2f4c194baa2c5cbb8b19" name="a0be8cf11055d2f4c194baa2c5cbb8b19"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>MACRO_STRING</b>(_Arg)&#160;&#160;&#160;MACRO_STRING_INNER(_Arg)</td></tr>
<tr class="separator:a0be8cf11055d2f4c194baa2c5cbb8b19"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3dab0009fb317e0fce558e09edd4964c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="godot__macros_8hpp.html#a3dab0009fb317e0fce558e09edd4964c">GDPROPERTY</a>(PropName_, PropType_)</td></tr>
<tr class="memdesc:a3dab0009fb317e0fce558e09edd4964c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register property. <br /></td></tr>
<tr class="separator:a3dab0009fb317e0fce558e09edd4964c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e70408fe612616931e2c251eb149114"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="godot__macros_8hpp.html#a9e70408fe612616931e2c251eb149114">GDPROPERTY_HINTED</a>(PropName_, PropType_, ...)</td></tr>
<tr class="memdesc:a9e70408fe612616931e2c251eb149114"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register a hinted property. <br /></td></tr>
<tr class="separator:a9e70408fe612616931e2c251eb149114"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aec4c8284cb9ea77c97a7037176081801"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="godot__macros_8hpp.html#aec4c8284cb9ea77c97a7037176081801">GDFUNCTION</a>(FnName_)&#160;&#160;&#160;godot::ClassDB::bind_method(godot::D_METHOD(#FnName_), &amp;CLASSNAME::FnName_)</td></tr>
<tr class="memdesc:aec4c8284cb9ea77c97a7037176081801"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register a function CLASSNAME::FnName_() to godot. <br /></td></tr>
<tr class="separator:aec4c8284cb9ea77c97a7037176081801"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abb5f0f48b26566dab84ff075fdc9fb4e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="godot__macros_8hpp.html#abb5f0f48b26566dab84ff075fdc9fb4e">GDFUNCTION_ARGS</a>(FnName_, ...)&#160;&#160;&#160;godot::ClassDB::bind_method(godot::D_METHOD(#FnName_, __VA_ARGS__), &amp;CLASSNAME::FnName_)</td></tr>
<tr class="memdesc:abb5f0f48b26566dab84ff075fdc9fb4e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register a function CLASSNAME::FnName_(...) to godot. <br /></td></tr>
<tr class="separator:abb5f0f48b26566dab84ff075fdc9fb4e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab1d89a5d5f8e83ed25d64195e8e432b6"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="godot__macros_8hpp.html#ab1d89a5d5f8e83ed25d64195e8e432b6">GDFUNCTION_STATIC</a>(FnName_)&#160;&#160;&#160;godot::ClassDB::bind_static_method(MACRO_STRING(CLASSNAME), godot::D_METHOD(#FnName_), &amp;CLASSNAME::_FnName)</td></tr>
<tr class="memdesc:ab1d89a5d5f8e83ed25d64195e8e432b6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register a static member function CLASSNAME::FnName_() to godot. <br /></td></tr>
<tr class="separator:ab1d89a5d5f8e83ed25d64195e8e432b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a26ae27fbaa531f900a2e3a2c339975df"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="godot__macros_8hpp.html#a26ae27fbaa531f900a2e3a2c339975df">GDFUNCTION_STATIC_ARGS</a>(FnName_, ...)&#160;&#160;&#160;godot::ClassDB::bind_static_method(MACRO_STRING(CLASSNAME), godot::D_METHOD(#FnName_, __VA_ARGS__), &amp;CLASSNAME::FnName_)</td></tr>
<tr class="memdesc:a26ae27fbaa531f900a2e3a2c339975df"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register a static member function CLASSNAME::FnName_(...) to godot. <br /></td></tr>
<tr class="separator:a26ae27fbaa531f900a2e3a2c339975df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abed0b44fb9b7da904a745cd09219ddea"><td class="memItemLeft" align="right" valign="top"><a id="abed0b44fb9b7da904a745cd09219ddea" name="abed0b44fb9b7da904a745cd09219ddea"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>GDSIGNAL</b>(...)&#160;&#160;&#160;godot::ClassDB::add_signal(MACRO_STRING(CLASSNAME), godot::MethodInfo(__VA_ARGS__))</td></tr>
<tr class="memdesc:abed0b44fb9b7da904a745cd09219ddea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Declare a godot Observer signal. <br /></td></tr>
<tr class="separator:abed0b44fb9b7da904a745cd09219ddea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae0818ebba543d3c6e8a61f460509451f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="godot__macros_8hpp.html#ae0818ebba543d3c6e8a61f460509451f">GDRESOURCETYPE</a>(Class_)&#160;&#160;&#160;godot::vformat(&quot;%s/%s:%s&quot;, godot::Variant::OBJECT, godot::PROPERTY_HINT_RESOURCE_TYPE, #Class_)</td></tr>
<tr class="memdesc:ae0818ebba543d3c6e8a61f460509451f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct godot resource type hint. <br /></td></tr>
<tr class="separator:ae0818ebba543d3c6e8a61f460509451f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a36c0da7ac54da4b5a5a9fe754e68eaa1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="godot__macros_8hpp.html#a36c0da7ac54da4b5a5a9fe754e68eaa1">GDEDITORONLY</a>()&#160;&#160;&#160;if(!godot::Engine::get_singleton()-&gt;is_editor_hint()) return;</td></tr>
<tr class="memdesc:a36c0da7ac54da4b5a5a9fe754e68eaa1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Execute the rest of the function only if currently running as editor. <br /></td></tr>
<tr class="separator:a36c0da7ac54da4b5a5a9fe754e68eaa1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a33ac9c3bfce05f857cfdd472cb00ca89"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="godot__macros_8hpp.html#a33ac9c3bfce05f857cfdd472cb00ca89">GDGAMEONLY</a>()&#160;&#160;&#160;if(godot::Engine::get_singleton()-&gt;is_editor_hint()) return;</td></tr>
<tr class="memdesc:a33ac9c3bfce05f857cfdd472cb00ca89"><td class="mdescLeft">&#160;</td><td class="mdescRight">Execute the rest of the function only if currently running as game. <br /></td></tr>
<tr class="separator:a33ac9c3bfce05f857cfdd472cb00ca89"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a069154a04e2e9e1df6cbbec0a0fc8829"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="godot__macros_8hpp.html#a069154a04e2e9e1df6cbbec0a0fc8829">GDENUM</a>(Name_, ...)</td></tr>
<tr class="memdesc:a069154a04e2e9e1df6cbbec0a0fc8829"><td class="mdescLeft">&#160;</td><td class="mdescRight">Declare a scoped enum struct. <br /></td></tr>
<tr class="separator:a069154a04e2e9e1df6cbbec0a0fc8829"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>C-style preprocessor macros to simplify using godot's C++ API. </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a36c0da7ac54da4b5a5a9fe754e68eaa1" name="a36c0da7ac54da4b5a5a9fe754e68eaa1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a36c0da7ac54da4b5a5a9fe754e68eaa1">&#9670;&#160;</a></span>GDEDITORONLY</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GDEDITORONLY</td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td>&#160;&#160;&#160;if(!godot::Engine::get_singleton()-&gt;is_editor_hint()) return;</td>
</tr>
</table>
</div><div class="memdoc">
<p>Execute the rest of the function only if currently running as editor. </p>
<p>Useful for _ready, _enter/_exit, _process, etc. functions. </p>
</div>
</div>
<a id="a069154a04e2e9e1df6cbbec0a0fc8829" name="a069154a04e2e9e1df6cbbec0a0fc8829"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a069154a04e2e9e1df6cbbec0a0fc8829">&#9670;&#160;</a></span>GDENUM</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GDENUM</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">Name_, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>...</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"><span class="keyword">struct </span>Name_ {\</div>
<div class="line"> <span class="keyword">enum</span> Value {__VA_ARGS__};\</div>
<div class="line"> <span class="keyword">private</span>:\</div>
<div class="line"> Value value{};\</div>
<div class="line"> <span class="keyword">public</span>:\</div>
<div class="line"> <span class="keyword">static</span> <span class="keyword">inline</span> godot::String get_property_hint() { <span class="keywordflow">return</span> godot::String(#__VA_ARGS__); }\</div>
<div class="line"> <span class="keyword">inline</span> Name_(Value value): value{value} {}\</div>
<div class="line"> <span class="keyword">inline</span> Name_(Name_ <span class="keyword">const</span> &amp;value): value{value.value} {}\</div>
<div class="line">}</div>
</div><!-- fragment -->
<p>Declare a scoped enum struct. </p>
<p>Declares a struct Name_ with an enum Value and a single variable and a get_property_hint() function. </p>
</div>
</div>
<a id="aec4c8284cb9ea77c97a7037176081801" name="aec4c8284cb9ea77c97a7037176081801"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aec4c8284cb9ea77c97a7037176081801">&#9670;&#160;</a></span>GDFUNCTION</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GDFUNCTION</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">FnName_</td><td>)</td>
<td>&#160;&#160;&#160;godot::ClassDB::bind_method(godot::D_METHOD(#FnName_), &amp;CLASSNAME::FnName_)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Register a function CLASSNAME::FnName_() to godot. </p>
<p>Requires setting CLASSNAME as a #define first. </p>
</div>
</div>
<a id="abb5f0f48b26566dab84ff075fdc9fb4e" name="abb5f0f48b26566dab84ff075fdc9fb4e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abb5f0f48b26566dab84ff075fdc9fb4e">&#9670;&#160;</a></span>GDFUNCTION_ARGS</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GDFUNCTION_ARGS</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">FnName_, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>...</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td>&#160;&#160;&#160;godot::ClassDB::bind_method(godot::D_METHOD(#FnName_, __VA_ARGS__), &amp;CLASSNAME::FnName_)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Register a function CLASSNAME::FnName_(...) to godot. </p>
<p>Requires setting CLASSNAME as a #define first. </p>
</div>
</div>
<a id="ab1d89a5d5f8e83ed25d64195e8e432b6" name="ab1d89a5d5f8e83ed25d64195e8e432b6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab1d89a5d5f8e83ed25d64195e8e432b6">&#9670;&#160;</a></span>GDFUNCTION_STATIC</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GDFUNCTION_STATIC</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">FnName_</td><td>)</td>
<td>&#160;&#160;&#160;godot::ClassDB::bind_static_method(MACRO_STRING(CLASSNAME), godot::D_METHOD(#FnName_), &amp;CLASSNAME::_FnName)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Register a static member function CLASSNAME::FnName_() to godot. </p>
<p>Requires setting CLASSNAME as a #define first. </p>
</div>
</div>
<a id="a26ae27fbaa531f900a2e3a2c339975df" name="a26ae27fbaa531f900a2e3a2c339975df"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a26ae27fbaa531f900a2e3a2c339975df">&#9670;&#160;</a></span>GDFUNCTION_STATIC_ARGS</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GDFUNCTION_STATIC_ARGS</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">FnName_, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>...</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td>&#160;&#160;&#160;godot::ClassDB::bind_static_method(MACRO_STRING(CLASSNAME), godot::D_METHOD(#FnName_, __VA_ARGS__), &amp;CLASSNAME::FnName_)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Register a static member function CLASSNAME::FnName_(...) to godot. </p>
<p>Requires setting CLASSNAME as a #define first. </p>
</div>
</div>
<a id="a33ac9c3bfce05f857cfdd472cb00ca89" name="a33ac9c3bfce05f857cfdd472cb00ca89"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a33ac9c3bfce05f857cfdd472cb00ca89">&#9670;&#160;</a></span>GDGAMEONLY</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GDGAMEONLY</td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td>&#160;&#160;&#160;if(godot::Engine::get_singleton()-&gt;is_editor_hint()) return;</td>
</tr>
</table>
</div><div class="memdoc">
<p>Execute the rest of the function only if currently running as game. </p>
<p>Useful for _ready, _enter/_exit, _process, etc. functions. </p>
</div>
</div>
<a id="a3dab0009fb317e0fce558e09edd4964c" name="a3dab0009fb317e0fce558e09edd4964c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3dab0009fb317e0fce558e09edd4964c">&#9670;&#160;</a></span>GDPROPERTY</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GDPROPERTY</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">PropName_, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname">PropType_&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"> godot::ClassDB::bind_method(godot::D_METHOD(<span class="stringliteral">&quot;get_&quot;</span> #PropName_), &amp;CLASSNAME::get_##PropName_); \</div>
<div class="line"> godot::ClassDB::bind_method(godot::D_METHOD(<span class="stringliteral">&quot;set_&quot;</span> #PropName_, <span class="stringliteral">&quot;value&quot;</span>), &amp;CLASSNAME::set_##PropName_); \</div>
<div class="line"> godot::ClassDB::add_property(MACRO_STRING(CLASSNAME), godot::PropertyInfo(PropType_, #PropName_), <span class="stringliteral">&quot;set_&quot;</span> #PropName_, <span class="stringliteral">&quot;get_&quot;</span> #PropName_)</div>
</div><!-- fragment -->
<p>Register property. </p>
<p>Register variable CLASSNAME::PropName_ with variant type PropType_. Requires setting CLASSNAME as a #define first. Also requires a CLASSNAME::get_PropName_ and CLASSNAME::set_PropName_ to exist. </p>
</div>
</div>
<a id="a9e70408fe612616931e2c251eb149114" name="a9e70408fe612616931e2c251eb149114"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9e70408fe612616931e2c251eb149114">&#9670;&#160;</a></span>GDPROPERTY_HINTED</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GDPROPERTY_HINTED</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">PropName_, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname">PropType_, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>...</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"> godot::ClassDB::bind_method(godot::D_METHOD(<span class="stringliteral">&quot;get_&quot;</span> #PropName_), &amp;CLASSNAME::get_##PropName_); \</div>
<div class="line"> godot::ClassDB::bind_method(godot::D_METHOD(<span class="stringliteral">&quot;set_&quot;</span> #PropName_, <span class="stringliteral">&quot;value&quot;</span>), &amp;CLASSNAME::set_##PropName_); \</div>
<div class="line"> godot::ClassDB::add_property(MACRO_STRING(CLASSNAME), godot::PropertyInfo(PropType_, #PropName_, __VA_ARGS__), <span class="stringliteral">&quot;set_&quot;</span> #PropName_, <span class="stringliteral">&quot;get_&quot;</span> #PropName_)</div>
</div><!-- fragment -->
<p>Register a hinted property. </p>
<p>Register variable CLASSNAME::PropName_ with variant type PropType_. Requires setting CLASSNAME as a #define first, and CLASSNAME::get_PropName and CLASSNAME::set_PropName_ to exist. </p>
</div>
</div>
<a id="ae0818ebba543d3c6e8a61f460509451f" name="ae0818ebba543d3c6e8a61f460509451f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae0818ebba543d3c6e8a61f460509451f">&#9670;&#160;</a></span>GDRESOURCETYPE</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GDRESOURCETYPE</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">Class_</td><td>)</td>
<td>&#160;&#160;&#160;godot::vformat(&quot;%s/%s:%s&quot;, godot::Variant::OBJECT, godot::PROPERTY_HINT_RESOURCE_TYPE, #Class_)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Construct godot resource type hint. </p>
<p>Use when registering properties of arrays of resource classes. </p>
</div>
</div>
</div><!-- contents -->
2024-05-29 22:09:05 +00:00
</div><!-- doc-content -->
2024-05-29 21:15:31 +00:00
<!-- start footer part -->
2024-05-29 22:09:05 +00:00
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="godot__macros_8hpp.html">godot_macros.hpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.7 </li>
</ul>
</div>
2024-05-29 21:15:31 +00:00
</body>
</html>