SpriteLibrary/SpriteLibrary/Doc/Help/html/154fc8b0-0d6c-003e-be50-c94...

49 lines
13 KiB
HTML
Raw Normal View History

2017-09-03 03:35:32 +02:00
<html><head><meta http-equiv="X-UA-Compatible" content="IE=edge" /><link rel="shortcut icon" href="../icons/favicon.ico" /><link rel="stylesheet" type="text/css" href="../styles/branding.css" /><link rel="stylesheet" type="text/css" href="../styles/branding-en-US.css" /><script type="text/javascript" src="../scripts/branding.js"> </script><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Sprite.AddAnimation Method </title><meta name="Language" content="en-us" /><meta name="System.Keywords" content="AddAnimation method" /><meta name="System.Keywords" content="Sprite.AddAnimation method" /><meta name="Microsoft.Help.F1" content="SpriteLibrary.Sprite.AddAnimation" /><meta name="Microsoft.Help.Id" content="Overload:SpriteLibrary.Sprite.AddAnimation" /><meta name="Microsoft.Help.ContentType" content="Reference" /><meta name="BrandingAware" content="true" /><meta name="container" content="SpriteLibrary" /><meta name="file" content="154fc8b0-0d6c-003e-be50-c94da6bc4597" /><meta name="guid" content="154fc8b0-0d6c-003e-be50-c94da6bc4597" /><link rel="stylesheet" type="text/css" href="../styles/branding-Website.css" /><script type="text/javascript" src="../scripts/jquery-1.11.0.min.js"></script><script type="text/javascript" src="../scripts/branding-Website.js"></script><script type="text/javascript" src="../scripts/clipboard.min.js"></script></head><body onload="OnLoad('cs')"><input type="hidden" id="userDataCache" class="userDataStyle" /><div class="pageHeader" id="PageHeader">SpriteLibrary<form id="SearchForm" method="get" action="#" onsubmit="javascript:TransferToSearchPage(); return false;"><input id="SearchTextBox" type="text" maxlength="200" /><button id="SearchButton" type="submit"></button></form></div><div class="pageBody"><div class="leftNav" id="leftNav"><div id="tocNav"><div class="toclevel0" data-toclevel="0"><a class="tocCollapsed" onclick="javascript: Toggle(this);" href="#!" /><a data-tochassubtree="true" href="6b7227c0-7a6a-6342-3b08-917c7de429cc.htm" title="SpriteLibrary" tocid="roottoc">SpriteLibrary</a></div><div class="toclevel0" data-toclevel="0"><a class="tocCollapsed" onclick="javascript: Toggle(this);" href="#!" /><a data-tochassubtree="true" href="6b7227c0-7a6a-6342-3b08-917c7de429cc.htm" title="SpriteLibrary" tocid="6b7227c0-7a6a-6342-3b08-917c7de429cc">SpriteLibrary</a></div><div class="toclevel0" data-toclevel="0"><a class="tocCollapsed" onclick="javascript: Toggle(this);" href="#!" /><a data-tochassubtree="true" href="66013d9b-4126-7d65-05bb-94eb9d134be6.htm" title="Sprite Class" tocid="66013d9b-4126-7d65-05bb-94eb9d134be6">Sprite Class</a></div><div class="toclevel0" data-toclevel="0"><a class="tocCollapsed" onclick="javascript: Toggle(this);" href="#!" /><a data-tochassubtree="true" href="abfab841-a96c-b22d-7cd8-fec3aba92510.htm" title="Sprite Methods" tocid="abfab841-a96c-b22d-7cd8-fec3aba92510">Sprite Methods</a></div><div class="toclevel1 current" data-toclevel="1" data-childrenloaded="true"><a class="tocExpanded" onclick="javascript: Toggle(this);" href="#!" /><a data-tochassubtree="true" href="154fc8b0-0d6c-003e-be50-c94da6bc4597.htm" title="AddAnimation Method " tocid="154fc8b0-0d6c-003e-be50-c94da6bc4597">AddAnimation Method </a></div><div class="toclevel2" data-toclevel="2"><a data-tochassubtree="false" href="e45036ef-15fa-9fbc-ef24-5e48c8c8ad8d.htm" title="AddAnimation Method (Image)" tocid="e45036ef-15fa-9fbc-ef24-5e48c8c8ad8d">AddAnimation Method (Image)</a></div><div class="toclevel2" data-toclevel="2"><a data-tochassubtree="false" href="4a6fe677-5369-6c0a-1e61-81355aa238b1.htm" title="AddAnimation Method (Image, Size)" tocid="4a6fe677-5369-6c0a-1e61-81355aa238b1">AddAnimation Method (Image, Size)</a></div><div class="toclevel2" data-toclevel="2"><a data-tochassubtree="false" href="5284b83c-61a7-aefe-4087-f7137551b783.htm" title="AddAnimation Method (Image, Int32)" tocid="5284b83c-61a7-aefe-4087-f7137551b783">AddAnimation Method (Image, Int32)</a></div><div class="toclevel2" data-toclevel="2"><a data-tochassubtree="false" href="eb5261e9-43df-01a5-b974-25c2f
 
</th><th>Name</th><th>Description</th></tr><tr data="public;declared;notNetfw;"><td><img src="../icons/pubmethod.gif" alt="Public method" title="Public method" /></td><td><a href="e45036ef-15fa-9fbc-ef24-5e48c8c8ad8d.htm">AddAnimation(Image)</a></td><td><div class="summary">
Add another animation to an existing Sprite. After you add animations, you can use
ChangeAnimation to select which animation you want the specified sprite to show.
For example, you may want to have Animation 0 be a guy walking left, and animation 1 is
that same guy walking right. Because we do not specify the number of frames, it starts
at the top-left corner and grabs as many frames as it can from the image.
</div></td></tr><tr data="public;declared;notNetfw;"><td><img src="../icons/pubmethod.gif" alt="Public method" title="Public method" /></td><td><a href="4a6fe677-5369-6c0a-1e61-81355aa238b1.htm">AddAnimation(Image, Size)</a></td><td><div class="summary">
Add another animation to an existing Sprite. After you add animations, you can use
ChangeAnimation to select which animation you want the specified sprite to show.
For example, you may want to have Animation 0 be a guy walking left, and animation 1 is
that same guy walking right. Because we do not specify the number of frames, it starts
at the top-left corner and grabs as many frames as it can from the image.
</div></td></tr><tr data="public;declared;notNetfw;"><td><img src="../icons/pubmethod.gif" alt="Public method" title="Public method" /></td><td><a href="5284b83c-61a7-aefe-4087-f7137551b783.htm">AddAnimation(Image, Int32)</a></td><td><div class="summary">
Add another animation to an existing Sprite. After you add animations, you can use
ChangeAnimation to select which animation you want the specified sprite to show.
For example, you may want to have Animation 0 be a guy walking left, and animation 1 is
that same guy walking right. Because we do not specify the number of frames, it starts
at the top-left corner and grabs as many frames as it can from the image.
</div></td></tr><tr data="public;declared;notNetfw;"><td><img src="../icons/pubmethod.gif" alt="Public method" title="Public method" /></td><td><a href="eb5261e9-43df-01a5-b974-25c2fd13309c.htm">AddAnimation(Int32, Int32)</a></td><td><div class="summary">
Duplicate an animation, except rotated by the specified number of degrees. For example, if you have
a single animation (0), and you want to rotate it by 90 degrees, it will create animation 1 with that
rotation to it. In the long haul, generating a few rotated animations is less memory intensive than
rotating it on demand.
</div></td></tr><tr data="public;declared;notNetfw;"><td><img src="../icons/pubmethod.gif" alt="Public method" title="Public method" /></td><td><a href="9d686d62-c22c-20ec-7455-b4adc8070b8c.htm">AddAnimation(Image, Int32, Int32)</a></td><td><div class="summary">
Add another animation to an existing Sprite. After you add animations, you can use
ChangeAnimation to select which animation you want the specified sprite to show.
For example, you may want to have Animation 0 be a guy walking left, and animation 1 is
that same guy walking right. Because we do not specify the number of frames, it starts
at the top-left corner and grabs as many frames as it can from the image.
</div></td></tr><tr data="public;declared;notNetfw;"><td><img src="../icons/pubmethod.gif" alt="Public method" title="Public method" /></td><td><a href="1730e5a3-3e48-72f7-f641-b7a70e5c2563.htm">AddAnimation(Int32, Boolean, Boolean)</a></td><td><div class="summary">
Duplicate an animation, except rotated by the specified number of degrees. For example, if you have
a single animation (0), and you want to rotate it by 90 degrees, it will create animation 1 with that
rotation to it. In the long haul, generating a few rotated animations is less memory intensive than
rotating it on demand using the <a href="c39b03eb-911a-b0dc-fd7b-276ee464f6c7.htm">MirrorHorizontally</a> or <a href="679ff642-b87f-24d6-80c5-434c06c71523.htm">MirrorVertically</a> booleans.
</div></td></tr><tr data="public;declared;notNetfw;"><td><img src="../icons/pubmethod.gif" alt="Public method" title="Public method" /></td><td><a href="a50146be-5b11-1554-db6f-817ea76b9343.htm">AddAnimation(Image, Int32, Int32, Int32)</a></td><td><div class="summary">
Add another animation to an existing Sprite. After you add animations, you can use
ChangeAnimation to select which animation you want the specified sprite to show.
For example, you may want to have Animation 0 be a guy walking left, and animation 1 is
that same guy walking right. Because we do not specify the number of frames, it starts
at the top-left corner and grabs as many frames as it can from the image.
</div></td></tr><tr data="public;declared;notNetfw;"><td><img src="../icons/pubmethod.gif" alt="Public method" title="Public method" /></td><td><a href="8ae70e13-ebdf-d78f-d7a4-69825f6b8c26.htm">AddAnimation(Point, Image, Int32, Int32, Int32, Int32)</a></td><td><div class="summary">
Add another animation to an existing Sprite. After you add animations, you can use
ChangeAnimation to select which animation you want the specified sprite to show.
For example, you may want to have Animation 0 be a guy walking left, and animation 1 is
that same guy walking right. Because we do not specify the number of frames, it starts
at the top-left corner and grabs as many frames as it can from the image.
</div></td></tr></table><a href="#PageHeader">Top</a></div><div class="collapsibleAreaRegion" id="seeAlsoSection"><span class="collapsibleRegionTitle" onclick="SectionExpandCollapse('ID1RB')" onkeypress="SectionExpandCollapse_CheckKey('ID1RB', event)" tabindex="0"><img id="ID1RBToggle" class="collapseToggle" src="../icons/SectionExpanded.png" />See Also</span></div><div id="ID1RBSection" class="collapsibleSection"><h4 class="subHeading">Reference</h4><div class="seeAlsoStyle"><a href="66013d9b-4126-7d65-05bb-94eb9d134be6.htm">Sprite Class</a></div><div class="seeAlsoStyle"><a href="6b7227c0-7a6a-6342-3b08-917c7de429cc.htm">SpriteLibrary Namespace</a></div></div></div></div><div id="pageFooter" class="pageFooter"> </div></body></html>