0
0
mirror of https://github.com/Nimac0/SDL_Minigame synced 2026-01-12 07:53:43 +00:00
SDL_Minigame/md_docs_2md-pages_2entitiesAndComponents.html

193 lines
11 KiB
HTML

<!-- HTML header for doxygen 1.10.0-->
<!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.13.2" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>VEGO-Engine: Entities and Components</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>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="doxygen-awesome-darkmode-toggle.js"></script>
<script type="text/javascript">
DoxygenAwesomeDarkModeToggle.init()
</script>
<script type="text/javascript" src="doxygen-awesome-fragment-copy-button.js"></script>
<script type="text/javascript">
DoxygenAwesomeFragmentCopyButton.init()
</script>
<script type="text/javascript" src="doxygen-awesome-paragraph-link.js"></script>
<script type="text/javascript">
DoxygenAwesomeParagraphLink.init()
</script>
<script type="text/javascript" src="doxygen-awesome-interactive-toc.js"></script>
<script type="text/javascript">
DoxygenAwesomeInteractiveToc.init()
</script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<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>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
<link href="doxygen-awesome-sidebar-only.css" rel="stylesheet" type="text/css"/>
<link href="doxygen-awesome-sidebar-only-darkmode-toggle.css" rel="stylesheet" type="text/css"/>
<link href="custom.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">VEGO-Engine
<span id="projectnumber">&#160;0.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.13.2 -->
<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>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</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 */
$(function(){initNavTree('md_docs_2md-pages_2entitiesAndComponents.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- 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><div class="header">
<div class="headertitle"><div class="title">Entities and Components</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><a class="anchor" id="autotoc_md2"></a></p>
<h1><a class="anchor" id="autotoc_md3"></a>
Entities</h1>
<p>In the scope of this library entities essentially function like empty containers that you can add components or properties to. So an entity can be whatever you want it to be, give it a texture, make it pickupable, give it collision or all of the above and more. Relevant functions for the creation and editing of Entities and Components: </p>
<h2><a class="anchor" id="autotoc_md4"></a>
Manager</h2>
<ul>
<li>[addEntity()]</li>
<li>[getAll()] </li>
</ul>
<h2><a class="anchor" id="autotoc_md5"></a>
Entity</h2>
<ul>
<li>[addComponent()]</li>
<li>[getComponent()]</li>
<li>[destroy()] <br />
</li>
</ul>
<p><b>If you are ever lost when looking for related functionality via search or side bar remember it is all neatly organized on this page for better readability and a better overview</b></p>
<h1><a class="anchor" id="autotoc_md6"></a>
Components</h1>
<p>The following components are currently available for you to use in your entities (the associated managers/handlers are also linked):</p>
<hr />
<h2><a class="anchor" id="autotoc_md8"></a>
<a class="el" href="classTransformComponent.html">Transform Component</a></h2>
<p>The Transform Component manages the position and movement of an <a class="el" href="classEntity.html" title="Main class for any object in game, stores associations, labeling and components.">Entity</a>. Multiple overloaded constructors exist depending on whether or not the entity is stationary</p>
<dl class="section important"><dt>Important</dt><dd>If an <a class="el" href="classEntity.html" title="Main class for any object in game, stores associations, labeling and components.">Entity</a> is supposed to be able to move the data entry "speed" has to be added and set to a positive int!</dd></dl>
<hr />
<h2><a class="anchor" id="autotoc_md10"></a>
<a class="el" href="classSpriteComponent.html">Sprite Component</a></h2>
<p><a class="el" href="classTextures.html" title="Forward declaration of the Textures enum class.">Textures</a> and Animations can be added via this component.</p>
<dl class="section important"><dt>Important</dt><dd>A <a class="el" href="classTransformComponent.html">Transform Component</a> is first needed before adding a Texture as the coordinates from the transform component are needed to tell the game where to render the texture</dd></dl>
<hr />
<h2><a class="anchor" id="autotoc_md12"></a>
<a class="el" href="classDataComponent.html">Data Component</a></h2>
<p>Custom Data such as Stats can be added to an <a class="el" href="classEntity.html" title="Main class for any object in game, stores associations, labeling and components.">Entity</a> and accessed using this Component.</p>
<hr />
<h2><a class="anchor" id="autotoc_md14"></a>
<a class="el" href="classColliderComponent.html">Collider Component</a></h2>
<p>see also <a class="el" href="classCollisionHandler.html">Collision Handler</a></p>
<p>Adds collision functionality to an <a class="el" href="classEntity.html" title="Main class for any object in game, stores associations, labeling and components.">Entity</a>. It is used to stop entities with a <a class="el" href="classEntity.html#a9449a7a0ad2c9ae5ee85ef2401382f2b">PLAYER group label</a> from running through tiles that were given the "collision" tag in the Tiled editor (see <a class="el" href="md_docs_2md-pages_2tilemaps.html">Tiled</a> section) or the <a class="el" href="classEntity.html#a9449a7a0ad2c9ae5ee85ef2401382f2b">COLLIDERS group label</a> in the code.</p>
<p>Also enables "picking up" other entities via <a class="el" href="classPickupComponent.html">Pickup Component</a>.</p>
<hr />
<h2><a class="anchor" id="autotoc_md16"></a>
<a class="el" href="classInteractionComponent.html">Interaction Component</a></h2>
<p>see also <a class="el" href="structInteractionEventdataStruct.html">InteractionEventdataStruct</a></p>
<p>Adding this component to an entity tells it to react to triggered Interactions for example by button press. For this a custom lambda or function pointer is passed to determine what exactly should happen once an entities ineraction was triggered.</p>
<dl class="section note"><dt>Note</dt><dd>You want certain buttons to do something? You're in the wrong place, see <a class="el" href="md_docs_2md-pages_2inputhandling.html">Input Management</a> This component is only used to assign a functionality to an entity to be triggered when it is interacted with, to actually map a button to do something such as trigger an interaction refer to <a class="el" href="md_docs_2md-pages_2inputhandling.html">Input Management</a> and <a class="el" href="md_docs_2md-pages_2eventhandling.html">Eventhandling</a></dd></dl>
<hr />
<h2><a class="anchor" id="autotoc_md18"></a>
<a class="el" href="classPickupComponent.html">Pickup Component</a></h2>
<p>see also <a class="el" href="classPickupManager.html">Pickup Manager</a></p>
<p>Entities with pickup components will disappear once another collision having entity with the <a class="el" href="classEntity.html#a9449a7a0ad2c9ae5ee85ef2401382f2b">Group Label</a> "Player" intersects with it and executes the custom functionality given to it via constructor.</p>
<hr />
<h2><a class="anchor" id="autotoc_md20"></a>
<a class="el" href="classStatEffectsComponent.html">Stat Effects Component</a></h2>
<p>Temporary stateffects can be added using this component. Using the time and function passed it will execute whatever is in the function after the given time. It is used to e.g. reset stats after raising them in order to allow for temporary stat raises </p>
</div></div><!-- contents -->
</div><!-- PageDoc -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<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.13.2 </li>
</ul>
</div>
</body>
</html>