<!DOCTYPE html>
<html>
<head>
<title>LEXSDL_CreateSprite</title>
<link rel="stylesheet" href="styles.css">
</head>
<header>
<h1>LEXSDL_CreateSprite</h1>
<hr>
</header>
<body>
<p>
Creates a new sprite.<br>
Will check if the texture is valid and return an error if its invalid.<br>
<br>
If the fps parameter is set to <span style=color:#f67400>0</span> the animation will be Steeped instead of timed.<br>
In the frameDimensions parameter the x is ignored and the y is preserved.<br>
The number of frames cannot be <span style=color:#f67400>0</span>, if a value of <span style=color:#f67400>0</span> is given it will be set to <span style=color:#f67400>1</span>.
</p>
<h2>Function</h2>
<code><ul>
<span style=color:#2980b9>int</span> LEXSDL_CreateSprite<span style=color:#66cf8d>(</span><span style=color:#2980b9>int</span> textureID<span style=color:#66cf8d>,</span> <span style=color:#2980b9>uint32_t</span> frames<span style=color:#66cf8d>,</span> <span style=color:#2980b9>uint32_t</span> fps<span style=color:#66cf8d>,</span> SDL_Rect frameDimensions<span style=color:#66cf8d>);</span>
</ul></code>
<h2>Return</h2>
<ul>
<span style=color:#f67400>0</span><span style=color:#66cf8d>+</span> : Creation was succesfull and the return value is the id.<br>
<span style=color:#66cf8d>-</span><span style=color:#f67400>1</span> : Failed to add the first sprite.<br>
<span style=color:#66cf8d>-</span><span style=color:#f67400>2</span> : Failed to add the sprite.<br>
<span style=color:#66cf8d>-</span><span style=color:#f67400>3</span> : The texture is invalid.<br>
</ul>
<h2>Parameters</h2>
<ul>
<span style=color:#2980b9>int</span> <b>textureID</b> : id of the texture to be used.<br>
<span style=color:#2980b9>uint32_t</span> <b>frames</b> : number of frames, cannot be <span style=color:#f67400>0</span>.<br>
<span style=color:#2980b9>uint32_t</span> <b>fps</b> : the quantity of fps, a value of <span style=color:#f67400>0</span> means the sprite is Steeped.<br>
SDL_Rect <b>frameDimensions</b> : dimensions of each frame, x is ignored and y is preserved.<br>
</ul>
</body>
<footer>
<br>
<hr>
<a href=FrontPage.html>FrontPage</a> <b>|</b> <a href=https://gitlab.com/Alexevier/lexsdl>GitLab</a> <b>|</b> <a href=https://crates.io/crates/lexsdl>Crates.io</a>
</footer>
</html>