<!-- clanlib header begin --> <HTML> <HEAD> <TITLE>CL_Sprite - ClanLib Game SDK</TITLE> <STYLE TYPE="text/css"><!-- HTML BODY { font-family: verdana, helvetica, sans-serif; font-size: 12px; } H1 { font-size: 22px; } H2 { font-size: 18px; } H3 { font-size: 16px; } H4 { font-size: 14px; } P { font-size: 12px; } LI { font-size: 12px; } --></STYLE> </HEAD> <body bgcolor=white text=black link=blue vlink=#800080> <center> <img src="http://clanlib.org/gfx/clanlib.png"> </center> <!-- clanlib header end --> <center> <p> <a href="http://clanlib.org/docs.html">Home</a> | <a href="classes.html">All Classes</a> | <a href="modules.html">Grouped Classes</a> | <a href="index.html">Index</a> | <a href="search.html">Search</a> </p> </center> <h1>Class CL_Sprite</h1> <p> This class handles displaying sprites on the screen. <a href="#description">More...</a></p> <p>Derived from: <i>none</i> <br> Derived by: <i>none</i> <br>Group: Display (Sprites)</p> <p> #include <ClanLib/display.h> <p> <table border=0 width=100%> </table> <p><b>Construction:</b></p> <table border=0 width=100%> <tr><td width=30% valign=top><p><a href="CL_Sprite__CL_Sprite.html">CL_Sprite</a></p></td><td valign=top><p> Constructs a sprite.</p></td></tr></table> <p><b>Attributes:</b></p> <table border=0 width=100%> <tr><td width=30% valign=top><p><a href="CL_Sprite__get_angle.html">get_angle</a></p></td><td valign=top><p> Returns current angle in degrees.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__get_angle_yaw.html">get_angle_yaw</a></p></td><td valign=top><p> Returns the current rotational yaw angle in degrees.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__get_angle_pitch.html">get_angle_pitch</a></p></td><td valign=top><p> Returns the current rotational pitch angle in degrees.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__get_base_angle.html">get_base_angle</a></p></td><td valign=top><p> Returns the base angle in degrees - angle added to any rotation set with set_rotate() or rotate().</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__get_scale.html">get_scale</a></p></td><td valign=top><p> Returns scale for x and y.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__get_alpha.html">get_alpha</a></p></td><td valign=top><p> Returns current alpha.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__get_color.html">get_color</a></p></td><td valign=top><p> Returns current color.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__get_blend_func.html">get_blend_func</a></p></td><td valign=top><p> Returns blending functions.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__get_alignment.html">get_alignment</a></p></td><td valign=top><p> Returns translation hotspot.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__get_rotation_hotspot.html">get_rotation_hotspot</a></p></td><td valign=top><p> Returns rotation hotspot.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__get_current_frame.html">get_current_frame</a></p></td><td valign=top><p> Returns current frame in animation. 0 is first frame.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__get_frame_count.html">get_frame_count</a></p></td><td valign=top><p> Returns number of frames in animation.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__get_frame_delay.html">get_frame_delay</a></p></td><td valign=top><p> Returns the delay of a frame. 0 is first frame.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__get_frame_offset.html">get_frame_offset</a></p></td><td valign=top><p> Returns the translation offset of a frame. 0 is first frame.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__get_frame_size.html">get_frame_size</a></p></td><td valign=top><p> Returns the size of a frame. 0 is first frame.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__get_width.html">get_width</a></p></td><td valign=top><p> Return the width of the current frame, shortcut for 'get_frame_size(get_current_frame()).width'</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__get_height.html">get_height</a></p></td><td valign=top><p> Return the height of the current frame, shortcut for 'get_frame_size(get_current_frame()).height'</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__get_frame_surface.html">get_frame_surface</a></p></td><td valign=top><p> Returns the surface of a frame. 0 is first frame.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__get_frame_pixeldata.html">get_frame_pixeldata</a></p></td><td valign=top><p> Returns a CL_PixelBuffer with the same dimensions as this sprite.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__get_id.html">get_id</a></p></td><td valign=top><p> Returns the attached id (if exists).</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__is_null.html">is_null</a></p></td><td valign=top><p> Returns true if this is an unattached sprite.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__is_play_loop.html">is_play_loop</a></p></td><td valign=top><p> Returns true if animation is played in loop (more than once).</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__is_play_backward.html">is_play_backward</a></p></td><td valign=top><p> Returns true if animation is played in from right to left (starts at end).</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__is_play_pingpong.html">is_play_pingpong</a></p></td><td valign=top><p> Returns true if animation is played in ping-pong mode.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__get_show_on_finish.html">get_show_on_finish</a></p></td><td valign=top><p> Returns an enum for what is shown when the animation is finished.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__is_finished.html">is_finished</a></p></td><td valign=top><p> Returns true if animation is finished.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__is_looping.html">is_looping</a></p></td><td valign=top><p> Returns true if animation has looped in the last update cycle</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__resource.html">resource</a></p></td><td valign=top><p> Resource owning this sprite, if any.</p></td></tr></table> <p><b>Operations:</b></p> <table border=0 width=100%> <tr><td width=30% valign=top><p><a href="CL_Sprite__operator =.html">operator =</a></p></td><td valign=top><p> Copy assignment operator.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__bool.html">bool</a></p></td><td valign=top><p> Return true if the CL_Sprite is valid and useable</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__set_image_data.html">set_image_data</a></p></td><td valign=top><p> Sets the image data from another sprite.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__draw.html">draw</a></p></td><td valign=top><p> Draw sprite on graphic context.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__draw_subpixel.html">draw_subpixel</a></p></td><td valign=top><p></p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__setup_draw_params.html">setup_draw_params</a></p></td><td valign=top><p> Calculate draw information and send it back. Returns false if sprite isn't currently drawn</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__update.html">update</a></p></td><td valign=top><p> Call this function to update the animation.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__set_angle.html">set_angle</a></p></td><td valign=top><p> Set absolute rotation angle in degrees.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__set_angle_pitch.html">set_angle_pitch</a></p></td><td valign=top><p> Set absolute rotation pitch angle in degrees.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__set_angle_yaw.html">set_angle_yaw</a></p></td><td valign=top><p> Set absolute rotation yaw angle in degrees.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__rotate.html">rotate</a></p></td><td valign=top><p> Add angle in degrees to current angle.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__rotate_pitch.html">rotate_pitch</a></p></td><td valign=top><p> Add angle in degrees to current pitch angle.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__rotate_yaw.html">rotate_yaw</a></p></td><td valign=top><p> Add angle in degrees to current yaw angle.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__set_base_angle.html">set_base_angle</a></p></td><td valign=top><p> Sets the base angle in degrees - angle added to any rotation set with set_rotate() or rotate().</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__set_scale.html">set_scale</a></p></td><td valign=top><p> Set scale for x and y directions individually.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__set_alpha.html">set_alpha</a></p></td><td valign=top><p> Sets transparency.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__set_color.html">set_color</a></p></td><td valign=top><p> Sets the color.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__set_blend_func.html">set_blend_func</a></p></td><td valign=top><p> Sets blending functions.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__set_blend_func_separate.html">set_blend_func_separate</a></p></td><td valign=top><p> Sets blending functions.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__set_alignment.html">set_alignment</a></p></td><td valign=top><p> Sets translation hotspot.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__set_rotation_hotspot.html">set_rotation_hotspot</a></p></td><td valign=top><p> Sets rotation hotspot.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__set_frame.html">set_frame</a></p></td><td valign=top><p> Sets current animation frame. 0 is first frame. It will cap to available range.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__set_frame_delay.html">set_frame_delay</a></p></td><td valign=top><p> Sets the delay of a specific frame. 0 is first frame.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__set_frame_offset.html">set_frame_offset</a></p></td><td valign=top><p> Sets the translate offset of a specific frame. 0 is first frame.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__set_id.html">set_id</a></p></td><td valign=top><p> Sets an attached id.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__finish.html">finish</a></p></td><td valign=top><p> Finish animation.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__restart.html">restart</a></p></td><td valign=top><p> Restart animation.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__set_play_loop.html">set_play_loop</a></p></td><td valign=top><p> Set to true if animation should loop, false otherwise.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__set_play_pingpong.html">set_play_pingpong</a></p></td><td valign=top><p> Set to true if animation should loop, false otherwise.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__set_play_backward.html">set_play_backward</a></p></td><td valign=top><p> Set to true if animation should go backward (start at end).</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__set_show_on_finish.html">set_show_on_finish</a></p></td><td valign=top><p> Set what is shown when the animation is finished.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_Sprite__add_frame.html">add_frame</a></p></td><td valign=top><p> Adds a frame to the animation</p></td></tr></table> <p><b>Signals:</b></p> <table border=0 width=100%> <tr><td width=30% valign=top><p><a href="CL_Sprite__sig_animation_finished.html">sig_animation_finished</a></p></td><td valign=top><p></p></td></tr></table> <a name="#description"><p><b>Detailed description:</b></p> !group=Display/Sprites! !header=display.h! <p>There are two overviews describing the sprite system in ClanLib. The <a href="../../Overview/sprites_overview.html">sprites overview</a>, and the <a href="../../Overview/sprites_resources.html">sprites resources overview.</a></p> <!-- clanlib footer begin --> <center><br><br><font color="#a0a0a0"> Questions or comments, write to the <a href="http://clanlib.org/contact.html">ClanLib mailing list</a>. </font></center> </body> </html> <!-- clanlib footer end -->